diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-06-12 17:18:03 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-14 05:42:49 +0200 |
commit | c88abd01775ea26f9552b89694ffb95b770af407 (patch) | |
tree | 73ad4ef4343adeaefc3ce2602d413fb2b0dfa82a /examples | |
parent | 940ef93c30d7b3421c3304762fed538dd1f41504 (diff) |
Replace a writable position() property with a seek() method.
Seeking is sometimes asynchronous, and more importantly nearly every
one using a slider for seeking ends up with a binding loop.
Change-Id: I45d92e19b0276c8b97c51c073754d1c9d3dc611e
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml | 1 | ||||
-rw-r--r-- | examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml | 1 | ||||
-rw-r--r-- | examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml index f46835f25..1d7205902 100644 --- a/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml +++ b/examples/video/qmlvideo/qml/qmlvideo/VideoDummy.qml @@ -71,4 +71,5 @@ Rectangle { function start() { } function stop() { } + function seek() { } } diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml index a086b3f35..f06ab981d 100644 --- a/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml +++ b/examples/video/qmlvideo/qml/qmlvideo/VideoItem.qml @@ -73,4 +73,5 @@ VideoOutput { function start() { mediaPlayer.play() } function stop() { mediaPlayer.stop() } + function seek(position) { mediaPlayer.seek(position); } } diff --git a/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml b/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml index 8b86db523..e8cb3edbe 100644 --- a/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml +++ b/examples/video/qmlvideo/qml/qmlvideo/VideoSeek.qml @@ -65,7 +65,7 @@ Scene { } duration: content.contentItem() ? content.contentItem().duration : 0 playPosition: content.contentItem() ? content.contentItem().position : 0 - onSeekPositionChanged: { content.contentItem().position = seekPosition } + onSeekPositionChanged: { content.contentItem().seek(seekPosition); } } Component.onCompleted: root.content = content |