diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index 1ed5d2f..ad7e2f0 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -163,6 +163,10 @@ Item { previewSlide.playVideo(); pauseVideo(); } + function onAudioChanged() { + showPassiveNotification("Audio should change"); + previewSlide.playAudio(); + } } function pauseVideo() { diff --git a/src/qml/presenter/Slide.qml b/src/qml/presenter/Slide.qml index 1d47f57..9973bb0 100644 --- a/src/qml/presenter/Slide.qml +++ b/src/qml/presenter/Slide.qml @@ -23,6 +23,7 @@ Item { property int pdfIndex property string chosenFont: "Quicksand" property string text: "This is demo text" + property string audioError property color backgroundColor property var hTextAlignment: Text.AlignHCenter property var vTextAlignment: Text.AlignVCenter @@ -107,12 +108,15 @@ Item { visible: false } - MediaPlayer { - id: audio - audioRole: MusicRole - autoLoad: true - autoPlay: true - source: audioSource.toString() + MpvObject { + id: mpvAudio + useHwdec: true + enableAudio: true + } + + Controls.Label { + id: error + text: audio.errorString } Image { @@ -171,7 +175,16 @@ Item { } function playAudio() { + audio.stop(); + audio.source = audioSource; + mpvAudio.loadFile(audioSource.toString()); audio.play(); + showPassiveNotification("We should be playing: " + audio.source) + showPassiveNotification(audio.status) + showPassiveNotification(audio.hasAudio) + showPassiveNotification(audio.duration) + showPassiveNotification(audio.errors) + showPassiveNotification(audio.errorString) } function stopVideo() {