Getting some functionality in switching slides

This commit is contained in:
Chris Cochrun 2022-03-11 07:04:23 -06:00
parent 1fa5aa8a0a
commit cc8f447166
7 changed files with 72 additions and 4 deletions

View file

@ -23,8 +23,14 @@ Item {
property string text: "This is demo text"
property color backgroundColor
//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")
// These properties help to determine the state of the slide
property string itemType
property bool preview: false
Rectangle {
id: basePrColor
@ -36,6 +42,7 @@ Item {
objectName: "mpv"
anchors.fill: parent
useHwdec: true
enableAudio: !preview
Component.onCompleted: mpvLoadingTimer.start()
onFileLoaded: {
print(videoSource + " has been loaded");
@ -49,6 +56,7 @@ Item {
anchors.fill: parent
enabled: editMode
onPressed: mpv.loadFile(videoSource.toString());
cursorShape: preview ? Qt.ArrowCursor : Qt.BlankCursor
}
Controls.ProgressBar {
@ -113,4 +121,8 @@ Item {
function loadVideo() {
mpvLoadingTimer.restart()
}
function stopVideo() {
mpv.stop()
}
}