From 8ca45f298f67127c4f70e0735a91138200b1f366 Mon Sep 17 00:00:00 2001 From: Andreas Gattringer Date: Mon, 15 Jul 2024 20:17:17 +0200 Subject: [PATCH] show thumbail when video is stopped --- src/timeline/VideoComponent.qml | 38 +++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/timeline/VideoComponent.qml b/src/timeline/VideoComponent.qml index f012bda99..6c725e7a5 100644 --- a/src/timeline/VideoComponent.qml +++ b/src/timeline/VideoComponent.qml @@ -97,7 +97,7 @@ Video { name: "notDownloaded" when: !root.fileTransferInfo.completed && !root.fileTransferInfo.active PropertyChanges { - target: noDownloadLabel + target: videoLabel visible: true } PropertyChanges { @@ -115,7 +115,7 @@ Video { }, State { name: "paused" - when: root.fileTransferInfo.completed && (root.playbackState === MediaPlayer.StoppedState || root.playbackState === MediaPlayer.PausedState) + when: root.fileTransferInfo.completed && root.playbackState === MediaPlayer.PausedState PropertyChanges { target: videoControls stateVisible: true @@ -141,6 +141,30 @@ Video { icon.name: "media-playback-pause" onClicked: root.pause() } + }, + State { + name: "stopped" + when: root.fileTransferInfo.completed && root.playbackState === MediaPlayer.StoppedState + PropertyChanges { + target: videoControls + stateVisible: true + } + PropertyChanges { + target: mediaThumbnail + visible: true + } + PropertyChanges { + target: videoLabel + visible: true + } + PropertyChanges { + target: playButton + icon.name: "media-playback-start" + onClicked: { + MediaManager.startPlayback(); + root.play(); + } + } } ] @@ -163,7 +187,7 @@ Video { } QQC2.Label { - id: noDownloadLabel + id: videoLabel anchors.centerIn: parent visible: false @@ -246,7 +270,7 @@ Video { } } onHoveredChanged: { - if (!hovered && (root.state === "paused" || root.state === "playing")) { + if (!hovered && (root.state === "paused" || root.state === "stopped" || root.state === "playing")) { videoControlTimer.restart(); volumePopupTimer.restart(); } @@ -276,7 +300,7 @@ Video { volumeButton.unmuteVolume = value; } onHoveredChanged: { - if (!hovered && (root.state === "paused" || root.state === "playing")) { + if (!hovered && (root.state === "paused" || root.state === "stopped" || root.state === "playing")) { videoControlTimer.restart(); volumePopupTimer.restart(); } @@ -289,7 +313,7 @@ Video { HoverHandler { id: volumePopupHoverHandler onHoveredChanged: { - if (!hovered && (root.state === "paused" || root.state === "playing")) { + if (!hovered && (root.state === "paused" || root.state === "stopped" || root.state === "playing")) { videoControlTimer.restart(); volumePopupTimer.restart(); } @@ -354,7 +378,7 @@ Video { HoverHandler { id: videoHoverHandler onHoveredChanged: { - if (!hovered && (root.state === "paused" || root.state === "playing")) { + if (!hovered && (root.state === "paused" || root.state === "stopped" || root.state === "playing")) { videoControlTimer.restart(); } }