IOS SOUND IMAGE: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
h1. IOS sound and image | |||
For to play sound file on | 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.<br />Here "https://github.com/niqt/iosqt&quot;:https://github.com/niqt/iosqt you can find my example that plays sound on IOS.<br />The most important part is this (in .pro file), where puts the qml and audio in the bundle: | ||
obviously you have to include the plugin: | <code><br />DATA_FILES = $$PWD/qml/iosqt/main.qml ../iosqt/page.qml ../iosqt/audio.mp3 | ||
ios: { | |||
data.files = $$DATA_FILES<br /> data.path = Documents<br /> QMAKE_BUNDLE_DATA ''= data<br /> }<br /></code> | |||
<br />obviously you have to include the plugin: | |||
<br /><code><br />QTPLUGIN''= qtaudio_coreaudio<br />QTPLUGIN ''= qtmedia_audioengine<br />QTPLUGIN''= qavfcamera<br />QTPLUGIN += qavfmediaplayer<br /></code> | |||
thus in main.qml: | thus in main.qml: | ||
<code><br />MediaPlayer {<br /> id: playMusic<br /> volume: 0.5<br /> source: "audio.mp3&quot;<br /> }<br /></code> | |||
Good fun | Good fun |
Revision as of 10:21, 24 February 2015
h1. IOS sound and image
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:
<br />DATA_FILES = $$PWD/qml/iosqt/main.qml ../iosqt/page.qml ../iosqt/audio.mp3
ios: {
data.files = $$DATA_FILES<br /> data.path = Documents<br /> QMAKE_BUNDLE_DATA ''= data<br /> }<br />
obviously you have to include the plugin:
<br />QTPLUGIN''= qtaudio_coreaudio<br />QTPLUGIN ''= qtmedia_audioengine<br />QTPLUGIN''= qavfcamera<br />QTPLUGIN += qavfmediaplayer<br />
thus in main.qml:
<br />MediaPlayer {<br /> id: playMusic<br /> volume: 0.5<br /> source: "audio.mp3&quot;<br /> }<br />
Good fun