diff options
author | Lars Knoll <lars.knoll@qt.io> | 2022-01-24 14:21:49 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-25 21:17:47 +0000 |
commit | 83df31233fe091a906a083d3d259abbbc64c2f6a (patch) | |
tree | 6710eaec9ff183e1704ccae5c4fb572623e52436 | |
parent | 2b1b9a38ea39f54e14e77a85be0d368219babcf3 (diff) |
Fix Video.seek() method
QMediaPlayer doesn't have a seek() method anymore, but
a writable position property.
Fixes: QTBUG-100106
Change-Id: Ia90b91abd850f1c61c9a226c5eced39ec8ed16b4
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit cb90823b7cb68efe8cebb77035d929b790901f76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/multimediaquick/Video.qml | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/multimediaquick/Video.qml b/src/multimediaquick/Video.qml index 1cee5514a..3b94c7321 100644 --- a/src/multimediaquick/Video.qml +++ b/src/multimediaquick/Video.qml @@ -71,8 +71,8 @@ import QtMultimedia focus: true Keys.onSpacePressed: video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play() - Keys.onLeftPressed: video.seek(video.position - 5000) - Keys.onRightPressed: video.seek(video.position + 5000) + Keys.onLeftPressed: video.position = video.position - 5000 + Keys.onRightPressed: video.position = video.position + 5000 } \endqml @@ -264,10 +264,6 @@ Item { \qmlproperty int Video::position This property holds the current playback position in milliseconds. - - To change this position, use the \l seek() method. - - \sa seek() */ property alias position: player.position @@ -277,7 +273,8 @@ Item { This property holds whether the playback position of the video can be changed. - If true, calling the \l seek() method will cause playback to seek to the new position. + If true, calling the \l seek() method or changing the \l position property + will cause playback to seek to the new position. */ property alias seekable: player.seekable @@ -391,12 +388,9 @@ Item { If the \l seekable property is true, seeks the current playback position to \a offset. - Seeking may be asynchronous, so the \l position property - may not be updated immediately. - \sa seekable, position */ function seek(offset) { - player.seek(offset); + player.position = offset; } } |