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:
committed by
Qt by Nokia
parent
940ef93c30
commit
c88abd0177
@@ -71,4 +71,5 @@ Rectangle {
|
||||
|
||||
function start() { }
|
||||
function stop() { }
|
||||
function seek() { }
|
||||
}
|
||||
|
||||
@@ -73,4 +73,5 @@ VideoOutput {
|
||||
|
||||
function start() { mediaPlayer.play() }
|
||||
function stop() { mediaPlayer.stop() }
|
||||
function seek(position) { mediaPlayer.seek(position); }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user