2018-01-31 21:54:25 +01:00
|
|
|
import QtQuick 2.9
|
2018-08-20 15:18:56 +02:00
|
|
|
import QtWebEngine 1.6
|
2018-01-31 21:54:25 +01:00
|
|
|
|
|
|
|
Rectangle {
|
2018-03-12 15:23:03 +01:00
|
|
|
id: root
|
2018-08-20 15:18:56 +02:00
|
|
|
color: "transparent"
|
2018-01-31 21:54:25 +01:00
|
|
|
anchors.fill: parent
|
2018-02-18 16:46:47 +01:00
|
|
|
property string tmpVideoPath
|
2018-02-23 11:56:36 +01:00
|
|
|
property var jsonProjectFile
|
|
|
|
|
2018-02-14 10:21:15 +01:00
|
|
|
Connections {
|
|
|
|
target: mainwindow
|
2018-03-12 15:23:03 +01:00
|
|
|
|
2018-02-18 16:46:47 +01:00
|
|
|
onPlayVideo: {
|
2018-08-20 15:18:56 +02:00
|
|
|
|
2018-02-23 11:56:36 +01:00
|
|
|
}
|
|
|
|
onPlayQmlScene: {
|
2018-03-14 13:58:57 +01:00
|
|
|
|
|
|
|
}
|
2018-08-20 15:18:56 +02:00
|
|
|
|
|
|
|
onFillModeChanged: {
|
|
|
|
|
2018-03-14 13:58:57 +01:00
|
|
|
}
|
2018-08-20 15:18:56 +02:00
|
|
|
onLoopsChanged: {
|
|
|
|
|
2018-03-14 13:58:57 +01:00
|
|
|
}
|
2018-08-20 15:18:56 +02:00
|
|
|
onVolumeChanged: {
|
2018-09-06 13:57:36 +02:00
|
|
|
if (webView.loadProgress === 100) {
|
|
|
|
webView.runJavaScript(
|
|
|
|
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = " + volume + ";")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onIsPlayingChanged: {
|
|
|
|
if (webView.loadProgress === 100) {
|
|
|
|
if (isPlaying === "false") {
|
|
|
|
webView.runJavaScript(
|
|
|
|
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.play();")
|
|
|
|
} else {
|
|
|
|
webView.runJavaScript(
|
|
|
|
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.pause();")
|
|
|
|
}
|
|
|
|
}
|
2018-08-20 15:18:56 +02:00
|
|
|
}
|
2018-02-12 15:35:08 +01:00
|
|
|
}
|
2018-02-23 11:56:36 +01:00
|
|
|
|
2018-08-20 15:18:56 +02:00
|
|
|
WebEngineView {
|
|
|
|
id: webView
|
2018-02-23 11:56:36 +01:00
|
|
|
anchors.fill: parent
|
2018-09-06 13:57:36 +02:00
|
|
|
url: Qt.resolvedUrl("file:///" + mainwindow.getApplicationPath(
|
|
|
|
) + "/index.html")
|
2018-08-20 15:18:56 +02:00
|
|
|
onLoadProgressChanged: {
|
|
|
|
if (loadProgress === 100) {
|
2018-09-06 13:57:36 +02:00
|
|
|
runJavaScript(("
|
|
|
|
var videoPlayer = document.getElementById('videoPlayer');
|
|
|
|
var videoSource = document.getElementById('videoSource');
|
|
|
|
videoSource.src = \"file:///" + mainwindow.fullContentPath + "\";
|
|
|
|
videoPlayer.load();
|
|
|
|
videoPlayer.volume = " + mainwindow.volume + ";"),
|
|
|
|
function (result) {
|
|
|
|
mainwindow.init()
|
|
|
|
timer.start()
|
|
|
|
})
|
2018-08-20 15:18:56 +02:00
|
|
|
}
|
|
|
|
}
|
2018-08-25 00:43:23 +02:00
|
|
|
onJavaScriptConsoleMessage: print(message)
|
|
|
|
settings.allowRunningInsecureContent: true
|
2018-03-12 15:23:03 +01:00
|
|
|
}
|
2018-09-06 13:57:36 +02:00
|
|
|
|
2018-08-20 15:18:56 +02:00
|
|
|
Timer {
|
2018-09-06 13:57:36 +02:00
|
|
|
id: timer
|
2018-08-25 00:43:23 +02:00
|
|
|
interval: 200
|
2018-08-20 15:18:56 +02:00
|
|
|
onTriggered: {
|
2018-08-25 00:43:23 +02:00
|
|
|
curtain.opacity = 0
|
|
|
|
anim.start()
|
|
|
|
print("start")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
2018-09-06 13:57:36 +02:00
|
|
|
id: curtain
|
2018-08-25 00:43:23 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
color: "black"
|
|
|
|
|
|
|
|
PropertyAnimation {
|
2018-09-06 13:57:36 +02:00
|
|
|
id: anim
|
2018-08-25 00:43:23 +02:00
|
|
|
property: "opacity"
|
|
|
|
target: curtain
|
|
|
|
from: "1"
|
|
|
|
to: "0"
|
|
|
|
duration: 300
|
2018-03-12 15:23:03 +01:00
|
|
|
}
|
2018-02-23 11:56:36 +01:00
|
|
|
}
|
2018-01-31 21:54:25 +01:00
|
|
|
}
|