From 9bc6e17a8f7fbca0ca4ee7f36902bd8e59576259 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 26 Sep 2022 05:52:45 -0500 Subject: [PATCH] fixing video background loading twice --- src/qml/presenter/Presentation.qml | 8 ++++++-- src/qml/presenter/Slide.qml | 12 +++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index ad7e2f0..13e0b3d 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -156,7 +156,10 @@ Item { Connections { target: SlideObject function onVideoBackgroundChanged() { - loadVideo(); + if (SlideObject.videoBackground === "") + stopVideo(); + else + loadVideo(); } function onIsPlayingChanged() { if(SlideObject.isPlaying) @@ -174,10 +177,12 @@ Item { } function loadVideo() { + showPassiveNotification("Loading Video " + vidbackground) previewSlide.loadVideo(); } function stopVideo() { + showPassiveNotification("Stopping Video") previewSlide.stopVideo() } @@ -193,7 +198,6 @@ Item { print(changed); if (changed) { currentServiceItem++; - loadVideo(); leftDock.changeItem(); } } diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index d3bfa10..dd02770 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -82,7 +82,6 @@ Item { print("WHY AREN'T YOU PASUING!"); pauseTimer.restart(); } - audio.source = audioSource.toString(); blackTimer.restart(); } } @@ -109,17 +108,12 @@ Item { } MpvObject { - id: mpvAudio + id: audio useHwdec: true enableAudio: true // embeded mpv allows to set commandline propertys using the options/ // syntax. This could be abstracted later, but for now this works. - Component.onCompleted: mpvAudio.setProperty("options/audio-display", "no"); - } - - Controls.Label { - id: error - text: audio.errorString + Component.onCompleted: audio.setProperty("options/audio-display", "no"); } Image { @@ -178,7 +172,7 @@ Item { } function playAudio() { - mpvAudio.loadFile(audioSource.toString()); + audio.loadFile(audioSource.toString()); } function stopVideo() {