summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/Video.qml
diff options
context:
space:
mode:
authorJim Hodapp <jim.hodapp@canonical.com>2015-08-03 14:27:16 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-08-10 15:12:22 +0000
commit23acd9f01d5dcca84025eb95de266e7e6b6cb386 (patch)
treebffd596d62312ed8be20075edb02b35ceec95cb0 /src/imports/multimedia/Video.qml
parent129b06ba77e451c08778badcd54cbaf193d195bc (diff)
Add audio role API to QMediaPlayer.
Change-Id: Ia5e3e2fe714f10b6aad62f0a4801c607905c7e0d Task-number: QTBUG-41054 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/imports/multimedia/Video.qml')
-rw-r--r--src/imports/multimedia/Video.qml45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/imports/multimedia/Video.qml b/src/imports/multimedia/Video.qml
index fda876805..9d28cabbd 100644
--- a/src/imports/multimedia/Video.qml
+++ b/src/imports/multimedia/Video.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtMultimedia 5.0
+import QtMultimedia 5.6
/*!
\qmltype Video
@@ -269,6 +269,35 @@ Item {
property alias position: player.position
/*!
+ \qmlproperty enumeration Video::audioRole
+
+ This property holds the role of the audio stream. It can be set to specify the type of audio
+ being played, allowing the system to make appropriate decisions when it comes to volume,
+ routing or post-processing.
+
+ The audio role must be set before setting the source property.
+
+ Supported values can be retrieved with supportedAudioRoles().
+
+ The value can be one of:
+ \list
+ \li MediaPlayer.UnknownRole - the role is unknown or undefined.
+ \li MediaPlayer.MusicRole - music.
+ \li MediaPlayer.VideoRole - soundtrack from a movie or a video.
+ \li MediaPlayer.VoiceCommunicationRole - voice communications, such as telephony.
+ \li MediaPlayer.AlarmRole - alarm.
+ \li MediaPlayer.NotificationRole - notification, such as an incoming e-mail or a chat request.
+ \li MediaPlayer.RingtoneRole - ringtone.
+ \li MediaPlayer.AccessibilityRole - for accessibility, such as with a screen reader.
+ \li MediaPlayer.SonificationRole - sonification, such as with user interface sounds.
+ \li MediaPlayer.GameRole - game audio.
+ \endlist
+
+ \since 5.6
+ */
+ property alias audioRole: player.audioRole
+
+ /*!
\qmlproperty bool Video::seekable
This property holds whether the playback position of the video can be
@@ -413,6 +442,20 @@ Item {
player.seek(offset);
}
+ /*!
+ \qmlmethod list<int> Video::supportedAudioRoles()
+
+ Returns a list of supported audio roles.
+
+ If setting the audio role is not supported, an empty list is returned.
+
+ \since 5.6
+ \sa audioRole
+ */
+ function supportedAudioRoles() {
+ return player.supportedAudioRoles();
+ }
+
}
// ***************************************