|
|
| (4 intermediate revisions by 2 users not shown) |
| Line 1: |
Line 1: |
| h1. IOS sound and image
| | #REDIRECT [[How to get sound on iOS]] |
| | |
| For to play sound file on IOS platform you can't store in qrc file but you must put it in the bundle together the qml files.
| |
| Here "https://github.com/niqt/iosqt":https://github.com/niqt/iosqt you can find my example that plays sound on IOS.
| |
| The most important part is this (in .pro file), where puts the qml and audio in the bundle:
| |
| | |
| <code>
| |
| DATA_FILES = $$PWD/qml/iosqt/main.qml ../iosqt/page.qml ../iosqt/audio.mp3
| |
| | |
| ios: {
| |
| | |
| data.files = $$DATA_FILES
| |
| data.path = Documents
| |
| QMAKE_BUNDLE_DATA ''= data
| |
| }
| |
| </code>
| |
| | |
| obviously you have to include the plugin:
| |
| | |
| <code>
| |
| QTPLUGIN''= qtaudio_coreaudio
| |
| QTPLUGIN ''= qtmedia_audioengine
| |
| QTPLUGIN''= qavfcamera
| |
| QTPLUGIN += qavfmediaplayer
| |
| </code>
| |
| | |
| thus in main.qml:
| |
| | |
| <code>
| |
| MediaPlayer {
| |
| id: playMusic
| |
| volume: 0.5
| |
| source: "audio.mp3"
| |
| }
| |
| </code>
| |
| | |
| Good fun
| |