1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-22 01:05:17 +00:00

VideoPlayer no longer jumps back after resuming

This commit is contained in:
Chris Josten 2020-10-01 22:15:17 +02:00
parent c01fcdcb54
commit dc395e9b3c

View file

@ -56,7 +56,6 @@ SilicaItem {
apiClient: ApiClient apiClient: ApiClient
itemId: playerRoot.itemId itemId: playerRoot.itemId
autoOpen: true autoOpen: true
//autoPlay: true
onStreamUrlChanged: { onStreamUrlChanged: {
if (mediaSource.streamUrl != "") { if (mediaSource.streamUrl != "") {
player.source = streamUrl player.source = streamUrl
@ -105,13 +104,14 @@ SilicaItem {
function stop() { function stop() {
player.stop() player.stop()
//player.source = ""
} }
Connections { Connections {
property bool enabled: true
id: playerReadyToSeek id: playerReadyToSeek
target: player target: player
onPlaybackStateChanged: { onPlaybackStateChanged: {
if (!enabled) return;
if (startTicks > 0 && player.playbackState == MediaPlayer.PlayingState) { if (startTicks > 0 && player.playbackState == MediaPlayer.PlayingState) {
console.log("Seeking to " + Utils.ticksToMs(startTicks)) console.log("Seeking to " + Utils.ticksToMs(startTicks))
player.seek(Utils.ticksToMs(startTicks)) player.seek(Utils.ticksToMs(startTicks))