adding a playpause ability in videos

This commit is contained in:
Chris Cochrun 2022-09-15 17:06:04 -05:00
parent 8b7cd23f8b
commit 9a180f7df0
5 changed files with 73 additions and 6 deletions

View file

@ -119,7 +119,7 @@ Item {
visible: itemType === "video";
MouseArea {
anchors.fill: parent
onPressed: print("pressed play/plause");
onPressed: SlideObject.playPause();
cursorShape: Qt.PointingHandCursor
}
}
@ -149,6 +149,22 @@ Item {
}
Connections {
target: SlideObject
onVideoBackgroundChanged: {
loadVideo();
}
onIsPlayingChanged: {
if(SlideObject.isPlaying)
previewSlide.playVideo();
pauseVideo();
}
}
function pauseVideo() {
previewSlide.pauseVideo();
}
function loadVideo() {
previewSlide.loadVideo();
}