fixing video no longer playing in Presentation.qml
This commit is contained in:
parent
b48e96a282
commit
a26144496c
1 changed files with 124 additions and 130 deletions
|
@ -92,141 +92,138 @@ FocusScope {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Item {
|
||||||
id: presenterView
|
id: presenterView
|
||||||
|
anchors.fill: parent
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
id: slideArea
|
||||||
Item {
|
implicitWidth: parent.width
|
||||||
id: slideArea
|
implicitHeight: parent.height - previewSlidesList.height
|
||||||
implicitWidth: parent.width
|
/* anchors.bottomMargin: previewSlidesList.height */
|
||||||
implicitHeight: parent.height - previewSlidesList.height
|
|
||||||
/* anchors.bottomMargin: previewSlidesList.height */
|
|
||||||
|
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
source: "arrow-left"
|
source: "arrow-left"
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 7
|
implicitWidth: Kirigami.Units.gridUnit * 7
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 10
|
implicitHeight: Kirigami.Units.gridUnit * 10
|
||||||
anchors.right: previewSlide.left
|
anchors.right: previewSlide.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressed: previousSlideAction()
|
onPressed: previousSlideAction()
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Presenter.Slide {
|
|
||||||
id: previewSlide
|
|
||||||
implicitWidth: root.width - 400 > 200 ? root.width - 400 : 200
|
|
||||||
implicitHeight: width / 16 * 9
|
|
||||||
anchors.centerIn: parent
|
|
||||||
textSize: SlideObject.fontSize
|
|
||||||
itemType: SlideObject.type
|
|
||||||
imageSource: SlideObject.imageBackground
|
|
||||||
videoSource: SlideObject.videoBackground
|
|
||||||
audioSource: SlideObject.audio
|
|
||||||
chosenFont: SlideObject.font
|
|
||||||
text: SlideObject.text
|
|
||||||
pdfIndex: SlideObject.pdfIndex
|
|
||||||
preview: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Kirigami.Icon {
|
|
||||||
source: "arrow-right"
|
|
||||||
implicitWidth: Kirigami.Units.gridUnit * 7
|
|
||||||
implicitHeight: Kirigami.Units.gridUnit * 10
|
|
||||||
anchors.left: previewSlide.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onPressed: nextSlideAction()
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
spacing: 2
|
|
||||||
width: previewSlide.width
|
|
||||||
/* Layout.alignment: Qt.AlignHCenter, Qt.AlignTop */
|
|
||||||
anchors.top: previewSlide.bottom
|
|
||||||
anchors.topMargin: 10
|
|
||||||
anchors.horizontalCenter: previewSlide.horizontalCenter
|
|
||||||
/* Layout.columnSpan: 3 */
|
|
||||||
visible: itemType === "video";
|
|
||||||
Controls.ToolButton {
|
|
||||||
Layout.preferredWidth: 25
|
|
||||||
Layout.preferredHeight: 25
|
|
||||||
icon.name: previewSlide.mpvIsPlaying ? "media-pause" : "media-play"
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: SlideObject.playPause();
|
|
||||||
}
|
|
||||||
Controls.Slider {
|
|
||||||
id: videoSlider
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 25
|
|
||||||
from: 0
|
|
||||||
to: previewSlide.mpvDuration
|
|
||||||
value: previewSlide.mpvPosition
|
|
||||||
live: true
|
|
||||||
onMoved: changeVidPos(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
Controls.Switch {
|
|
||||||
text: "Loop"
|
|
||||||
checked: previewSlide.mpvLoop === "inf" ? true : false
|
|
||||||
onToggled: mainPage.loopVideo()
|
|
||||||
Keys.onLeftPressed: previousSlideAction()
|
|
||||||
Keys.onRightPressed: nextSlideAction()
|
|
||||||
Keys.onUpPressed: previousSlideAction()
|
|
||||||
Keys.onDownPressed: nextSlideAction()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
Presenter.Slide {
|
||||||
// The active items X value from root
|
id: previewSlide
|
||||||
property int activeX
|
implicitWidth: root.width - 400 > 200 ? root.width - 400 : 200
|
||||||
id: previewSlidesList
|
implicitHeight: width / 16 * 9
|
||||||
anchors.bottom: parent.bottom
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
textSize: SlideObject.fontSize
|
||||||
height: Kirigami.Units.gridUnit * 9
|
itemType: SlideObject.type
|
||||||
orientation: ListView.Horizontal
|
imageSource: SlideObject.imageBackground
|
||||||
spacing: Kirigami.Units.smallSpacing * 2
|
videoSource: SlideObject.videoBackground
|
||||||
cacheBuffer: 900
|
audioSource: SlideObject.audio
|
||||||
reuseItems: true
|
chosenFont: SlideObject.font
|
||||||
model: SlideModel
|
text: SlideObject.text
|
||||||
delegate: Presenter.PreviewSlideListDelegate {}
|
pdfIndex: SlideObject.pdfIndex
|
||||||
|
preview: true
|
||||||
Kirigami.WheelHandler {
|
|
||||||
id: wheelHandler
|
|
||||||
target: previewSlidesList
|
|
||||||
filterMouseEvents: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Controls.ScrollBar.horizontal: Controls.ScrollBar {
|
|
||||||
active: hovered || pressed
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Kirigami.Icon {
|
||||||
id: activeHighlightBar
|
source: "arrow-right"
|
||||||
width: Kirigami.Units.gridUnit * 10
|
implicitWidth: Kirigami.Units.gridUnit * 7
|
||||||
height: Kirigami.Units.gridUnit / 4
|
implicitHeight: Kirigami.Units.gridUnit * 10
|
||||||
y: previewSlidesList.y + Kirigami.Units.gridUnit * 6.15
|
anchors.left: previewSlide.right
|
||||||
x: previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
radius: 5
|
MouseArea {
|
||||||
color: Kirigami.Theme.negativeTextColor
|
anchors.fill: parent
|
||||||
|
onPressed: nextSlideAction()
|
||||||
Behavior on x { PropertyAnimation {
|
cursorShape: Qt.PointingHandCursor
|
||||||
properties: "x"
|
}
|
||||||
easing.type: Easing.InOutElastic;
|
|
||||||
easing.period: 1.5
|
|
||||||
duration: 150
|
|
||||||
}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 2
|
||||||
|
width: previewSlide.width
|
||||||
|
/* Layout.alignment: Qt.AlignHCenter, Qt.AlignTop */
|
||||||
|
anchors.top: previewSlide.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
|
anchors.horizontalCenter: previewSlide.horizontalCenter
|
||||||
|
/* Layout.columnSpan: 3 */
|
||||||
|
visible: itemType === "video";
|
||||||
|
Controls.ToolButton {
|
||||||
|
Layout.preferredWidth: 25
|
||||||
|
Layout.preferredHeight: 25
|
||||||
|
icon.name: previewSlide.mpvIsPlaying ? "media-pause" : "media-play"
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: SlideObject.playPause();
|
||||||
|
}
|
||||||
|
Controls.Slider {
|
||||||
|
id: videoSlider
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 25
|
||||||
|
from: 0
|
||||||
|
to: previewSlide.mpvDuration
|
||||||
|
value: previewSlide.mpvPosition
|
||||||
|
live: true
|
||||||
|
onMoved: changeVidPos(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.Switch {
|
||||||
|
text: "Loop"
|
||||||
|
checked: previewSlide.mpvLoop === "inf" ? true : false
|
||||||
|
onToggled: mainPage.loopVideo()
|
||||||
|
Keys.onLeftPressed: previousSlideAction()
|
||||||
|
Keys.onRightPressed: nextSlideAction()
|
||||||
|
Keys.onUpPressed: previousSlideAction()
|
||||||
|
Keys.onDownPressed: nextSlideAction()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
// The active items X value from root
|
||||||
|
property int activeX
|
||||||
|
id: previewSlidesList
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
width: parent.width
|
||||||
|
height: Kirigami.Units.gridUnit * 9
|
||||||
|
orientation: ListView.Horizontal
|
||||||
|
spacing: Kirigami.Units.smallSpacing * 2
|
||||||
|
cacheBuffer: 900
|
||||||
|
reuseItems: true
|
||||||
|
model: SlideModel
|
||||||
|
delegate: Presenter.PreviewSlideListDelegate {}
|
||||||
|
|
||||||
|
Kirigami.WheelHandler {
|
||||||
|
id: wheelHandler
|
||||||
|
target: previewSlidesList
|
||||||
|
filterMouseEvents: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Controls.ScrollBar.horizontal: Controls.ScrollBar {
|
||||||
|
active: hovered || pressed
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: activeHighlightBar
|
||||||
|
width: Kirigami.Units.gridUnit * 10
|
||||||
|
height: Kirigami.Units.gridUnit / 4
|
||||||
|
y: previewSlidesList.y + Kirigami.Units.gridUnit * 6.15
|
||||||
|
x: previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing
|
||||||
|
radius: 5
|
||||||
|
color: Kirigami.Theme.negativeTextColor
|
||||||
|
|
||||||
|
Behavior on x { PropertyAnimation {
|
||||||
|
properties: "x"
|
||||||
|
easing.type: Easing.InOutElastic;
|
||||||
|
easing.period: 1.5
|
||||||
|
duration: 150
|
||||||
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,16 +282,13 @@ FocusScope {
|
||||||
stopVideo();
|
stopVideo();
|
||||||
else
|
else
|
||||||
loadVideo();
|
loadVideo();
|
||||||
|
playVideo();
|
||||||
}
|
}
|
||||||
function onIsPlayingChanged() {
|
function onIsPlayingChanged() {
|
||||||
if(SlideObject.isPlaying)
|
if(SlideObject.isPlaying)
|
||||||
previewSlide.playVideo();
|
previewSlide.playVideo();
|
||||||
pauseVideo();
|
pauseVideo();
|
||||||
}
|
}
|
||||||
/* function onAudioChanged() { */
|
|
||||||
/* showPassiveNotification("Audio should change"); */
|
|
||||||
/* previewSlide.playAudio(); */
|
|
||||||
/* } */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue