gave up on qt and using mpv for audio too
This commit is contained in:
parent
7f94cc37e7
commit
48514667cf
2 changed files with 23 additions and 6 deletions
|
@ -163,6 +163,10 @@ Item {
|
||||||
previewSlide.playVideo();
|
previewSlide.playVideo();
|
||||||
pauseVideo();
|
pauseVideo();
|
||||||
}
|
}
|
||||||
|
function onAudioChanged() {
|
||||||
|
showPassiveNotification("Audio should change");
|
||||||
|
previewSlide.playAudio();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function pauseVideo() {
|
function pauseVideo() {
|
||||||
|
|
|
@ -23,6 +23,7 @@ Item {
|
||||||
property int pdfIndex
|
property int pdfIndex
|
||||||
property string chosenFont: "Quicksand"
|
property string chosenFont: "Quicksand"
|
||||||
property string text: "This is demo text"
|
property string text: "This is demo text"
|
||||||
|
property string audioError
|
||||||
property color backgroundColor
|
property color backgroundColor
|
||||||
property var hTextAlignment: Text.AlignHCenter
|
property var hTextAlignment: Text.AlignHCenter
|
||||||
property var vTextAlignment: Text.AlignVCenter
|
property var vTextAlignment: Text.AlignVCenter
|
||||||
|
@ -107,12 +108,15 @@ Item {
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaPlayer {
|
MpvObject {
|
||||||
id: audio
|
id: mpvAudio
|
||||||
audioRole: MusicRole
|
useHwdec: true
|
||||||
autoLoad: true
|
enableAudio: true
|
||||||
autoPlay: true
|
}
|
||||||
source: audioSource.toString()
|
|
||||||
|
Controls.Label {
|
||||||
|
id: error
|
||||||
|
text: audio.errorString
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
|
@ -171,7 +175,16 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function playAudio() {
|
function playAudio() {
|
||||||
|
audio.stop();
|
||||||
|
audio.source = audioSource;
|
||||||
|
mpvAudio.loadFile(audioSource.toString());
|
||||||
audio.play();
|
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() {
|
function stopVideo() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue