ui components to control looping on the fly

This commit is contained in:
Chris Cochrun 2022-10-06 03:33:56 -05:00
parent 39ea1eb759
commit a3be06639b
7 changed files with 58 additions and 10 deletions

View file

@ -31,7 +31,7 @@ Item {
//these properties are for giving video info to parents
property int mpvPosition: mpv.position
property int mpvDuration: mpv.duration
property var mpvLoop: mpv.getProperty("loop")
property var mpvLoop: mpv.loop
property bool mpvIsPlaying: mpv.isPlaying
// These properties help to determine the state of the slide
@ -167,6 +167,17 @@ Item {
lyrics.text = text
}
function loopVideo() {
if (mpv.getProperty("loop") === "inf") {
showPassiveNotification("already looping");
mpv.setProperty("loop", "no");
}
else {
mpv.setProperty("loop", "inf");
showPassiveNotification("looping video");
}
}
function loadVideo() {
mpvLoadingTimer.restart()
}