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>
This commit is contained in:
Michael Goddard
2012-06-12 17:18:03 +10:00
committed by Qt by Nokia
parent 940ef93c30
commit c88abd0177
6 changed files with 58 additions and 29 deletions

View File

@@ -71,4 +71,5 @@ Rectangle {
function start() { }
function stop() { }
function seek() { }
}

View File

@@ -73,4 +73,5 @@ VideoOutput {
function start() { mediaPlayer.play() }
function stop() { mediaPlayer.stop() }
function seek(position) { mediaPlayer.seek(position); }
}

View File

@@ -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