How to deploy audio/video files together with iOS/Android app? Using Qt 5.3

857 Views Asked by At

I have learned that I can not bundle audio/video files within resource file in order to play them in my qml.

So, I have tried to use DEPLOYMENTFOLDERS in .pro file it does not copy the files. It seems that QtCreator does not generate necessary code contents using DEPLOYMENTFOLDERS in .pri file.

Is there an easy way to say copy these files into build output location? Visual studio C# has this option just saying one true/false to do this. It should not be this hard. :-)

1

There are 1 best solutions below

0
On

"Is there an easy way to say copy these files into build output location?" - this is a different task. You may achieve that with QMAKE_POST_LINK and writing a Makefile rule to copy the required files to the the output directory.

To copy the required file into the iOS bundle use QMAKE_BUNDLE_DATA. See https://qt-project.org/doc/qt-5-snapshot/platform-notes-ios.html

To copy the required file into the Andoid APK you need to write INSTALLS rules like that:

android {
    ...
    assets.path = /assets
    assets.files += LIST_OF_FILES
    INSTALLS += assets
}