summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/Video.qml
diff options
context:
space:
mode:
authorAngus Cummings <angus.cummings@nokia.com>2012-02-03 11:49:47 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-08 03:48:51 +0100
commita94c8a1ac26f4a5a79d63672d21538d016bc09f4 (patch)
treeaaadf76db98dbf9d1ba228c7e0c68868242f0355 /src/imports/multimedia/Video.qml
parent66b86ba5812ba15c177f7c6b2916bca4376749ce (diff)
API changes to QML element MediaPlayer aka Audio
Changed Video.qml for new API Removed lowercase enum copies, replaced with calling parent (VideoOutput, MediaPlayer) enums Removed properties playing, paused Removed signals started, resumed Added readonly property playbackState Added signal playing Added autoPlay property Fixed unit tests for new API Added backwards compatibility for QtMultimedia 4 Change-Id: I27c91cd46d91402b8c4c42bb7d4961ad67909aeb Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/imports/multimedia/Video.qml')
-rw-r--r--src/imports/multimedia/Video.qml92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/imports/multimedia/Video.qml b/src/imports/multimedia/Video.qml
index e62e98a8a..a8f67e79c 100644
--- a/src/imports/multimedia/Video.qml
+++ b/src/imports/multimedia/Video.qml
@@ -95,17 +95,16 @@ Item {
area.
\list
- \o stretch - the video is scaled to fit.
- \o preserveAspectFit - the video is scaled uniformly to fit without
+ \o VideoOutput.Stretch - the video is scaled to fit
+ \o VideoOutput.PreserveAspectFit - the video is scaled uniformly to fit without
cropping
- \o preserveAspectCrop - the video is scaled uniformly to fill, cropping
+ \o VideoOuput.PreserveAspectCrop - the video is scaled uniformly to fill, cropping
if necessary
\endlist
Because this element is a convenience element in QML, it does not
- support enumerations directly. In contrast to \l VideoOutput and other
- elements, the values to set for fillMode all start with lowercase
- letters to work around this.
+ support enumerations directly, so enumerations from VideoOuput are
+ used to access the available fill modes.
The default fill mode is preserveAspectFit.
*/
@@ -119,15 +118,24 @@ Item {
*/
property alias orientation: videoOut.orientation
- /* Properties to emulate enumeration for fillMode, documented above */
- /*! \internal */
- readonly property int stretch: VideoOutput.Stretch
- /*! \internal */
- readonly property int preserveAspectFit: VideoOutput.PreserveAspectFit
- /*! \internal */
- readonly property int preserveAspectCrop: VideoOutput.PreserveAspectCrop
/*** Properties of MediaPlayer ***/
+
+ /*!
+ \qmlproperty enumeration Video::playbackState
+
+ This read only property indicates the playback state of the media.
+
+ \list
+ \o MediaPlayer.PlayingState - the media is playing
+ \o MediaPlayer.PausedState - the media is paused
+ \o MediaPlayer.StoppedState - the media is stopped
+ \endlist
+
+ The default state is MediaPlayer.StoppedState.
+ */
+ property alias playbackState: player.playbackState
+
/*!
\qmlproperty bool Video::autoLoad
@@ -195,15 +203,6 @@ Item {
property alias muted: player.muted
/*!
- \qmlproperty bool Video::paused
-
- This property holds whether the media is paused.
-
- Defaults to false, and can be set to true to pause playback.
- */
- property alias paused: player.paused
-
- /*!
\qmlproperty real Video::playbackRate
This property holds the rate at which video is played at as a multiple
@@ -212,15 +211,6 @@ Item {
property alias playbackRate: player.playbackRate
/*!
- \qmlproperty bool Video::playing
-
- This property holds whether the media is playing.
-
- Defaults to false, and can be set to true to start playback.
- */
- property alias playing: player.playing
-
- /*!
\qmlproperty int Video::position
This property holds the current playback position in milliseconds.
@@ -269,17 +259,19 @@ Item {
property alias volume: player.volume
/*!
- \qmlsignal Video::resumed()
+ \qmlproperty bool Video::autoPlay
- This signal is emitted when playback is resumed from the paused state.
+ This property determines whether the media should begin playback automatically.
*/
- signal resumed
+ property alias autoPlay: player.autoPlay
+
/*!
- \qmlsignal Video::started()
+ \qmlsignal Video::paused()
- This signal is emitted when playback is started.
+ This signal is emitted when playback is paused.
*/
- signal started
+ signal paused
+
/*!
\qmlsignal Video::stopped()
@@ -287,6 +279,19 @@ Item {
*/
signal stopped
+ /*!
+ \qmlsignal Video::playing()
+
+ This signal is emitted when playback is started or continued.
+ */
+ signal playing
+
+ /*!
+ \qmlsignal Video::playbackStateChanged()
+
+ This signal is emitted whenever the state of playback changes.
+ */
+ signal playbackStateChanged
VideoOutput {
id: videoOut
@@ -296,18 +301,17 @@ Item {
MediaPlayer {
id: player
- onResumed: video.resumed()
- onStarted: video.started()
+ onPaused: video.paused()
onStopped: video.stopped()
+ onPlaying: video.playing()
+
+ onPlaybackStateChanged: video.playbackStateChanged()
}
/*!
\qmlmethod Video::play()
Starts playback of the media.
-
- Sets the \l playing property to true, and the \l paused property to
- false.
*/
function play() {
player.play();
@@ -317,8 +321,6 @@ Item {
\qmlmethod Video::pause()
Pauses playback of the media.
-
- Sets the \l playing and \l paused properties to true.
*/
function pause() {
player.pause();
@@ -328,8 +330,6 @@ Item {
\qmlmethod Video::stop()
Stops playback of the media.
-
- Sets the \l playing and \l paused properties to false.
*/
function stop() {
player.stop();