diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index a6df7ea..b26d070 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -166,10 +166,10 @@ Item { previewSlide.playVideo(); pauseVideo(); } - function onAudioChanged() { - showPassiveNotification("Audio should change"); - previewSlide.playAudio(); - } + /* function onAudioChanged() { */ + /* showPassiveNotification("Audio should change"); */ + /* previewSlide.playAudio(); */ + /* } */ } function pauseVideo() { diff --git a/src/qml/presenter/PresentationWindow.qml b/src/qml/presenter/PresentationWindow.qml index 05ef963..e2e5791 100644 --- a/src/qml/presenter/PresentationWindow.qml +++ b/src/qml/presenter/PresentationWindow.qml @@ -23,6 +23,7 @@ Window { onClosing: { presentationSlide.stopVideo(); SlideObject.pause(); + presentationSlide.stopAudio(); presenting = false; } @@ -35,6 +36,7 @@ Window { anchors.fill: parent imageSource: SlideObject.imageBackground videoSource: presentationWindow.visible ? SlideObject.videoBackground : "" + audioSource: SlideObject.audio text: SlideObject.text pdfIndex: SlideObject.pdfIndex itemType: SlideObject.type @@ -43,13 +45,24 @@ Window { Connections { target: SlideObject function onVideoBackgroundChanged() { - loadVideo(); + if (SlideObject.videoBackground === "") + stopVideo(); + else { + loadVideo(); + playVideo(); + } } function onIsPlayingChanged() { if(SlideObject.isPlaying) presentationSlide.playVideo(); pauseVideo(); } + function onAudioChanged() { + if (presentationWindow.visible) + presentationSlide.playAudio(); + else + presentationWindow.stopAudio(); + } } function loadVideo() { diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index dd02770..9c573ab 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -172,9 +172,14 @@ Item { } function playAudio() { + showPassiveNotification("Audio should change"); audio.loadFile(audioSource.toString()); } + function stopAudio() { + audio.stop(); + } + function stopVideo() { mpv.stop(); black.visible = true;