mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Restore qml wallpaper functionality
This commit is contained in:
parent
300f98aff0
commit
c7e5f1f722
@ -10,20 +10,16 @@ Rectangle {
|
||||
|
||||
Connections {
|
||||
target: mainwindow
|
||||
|
||||
onPlayVideo: {
|
||||
|
||||
}
|
||||
onPlayQmlScene: {
|
||||
|
||||
}
|
||||
|
||||
onFillModeChanged: {
|
||||
|
||||
}
|
||||
onLoopsChanged: {
|
||||
|
||||
}
|
||||
onTypeChanged: {
|
||||
print(mainwindow.type)
|
||||
}
|
||||
|
||||
onVolumeChanged: {
|
||||
if (webView.loadProgress === 100) {
|
||||
webView.runJavaScript(
|
||||
@ -43,36 +39,55 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (mainwindow.type === "qmlScene") {
|
||||
loader.setSource(Qt.resolvedUrl(
|
||||
"file:///" + mainwindow.fullContentPath))
|
||||
print("LOADING QMLSCENE" + loader.source)
|
||||
mainwindow.init()
|
||||
timer.start()
|
||||
} else if (mainwindow.type === "video") {
|
||||
webView.visible = true
|
||||
webView.url = Qt.resolvedUrl("file:///" + mainwindow.getApplicationPath(
|
||||
) + "/index.html")
|
||||
}
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
id: webView
|
||||
anchors.fill: parent
|
||||
url: Qt.resolvedUrl("file:///" + mainwindow.getApplicationPath(
|
||||
) + "/index.html")
|
||||
visible: false
|
||||
|
||||
onLoadProgressChanged: {
|
||||
if (loadProgress === 100) {
|
||||
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()
|
||||
})
|
||||
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()
|
||||
})
|
||||
}
|
||||
}
|
||||
onJavaScriptConsoleMessage: print(message)
|
||||
settings.allowRunningInsecureContent: true
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
onStatusChanged: {
|
||||
print(webViewWrapper.errorString())
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: 200
|
||||
onTriggered: {
|
||||
curtain.opacity = 0
|
||||
anim.start()
|
||||
print("start")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,13 +59,13 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
|
||||
if (m_project.value("type") == "video") {
|
||||
QString tmpPath = m_projectPath.toString() + "/" + m_projectFile;
|
||||
setFullContentPath(tmpPath);
|
||||
|
||||
emit playVideo(tmpPath);
|
||||
setType("video");
|
||||
} else if (m_project.value("type") == "scene") {
|
||||
return;
|
||||
} else if (m_project.value("type") == "qmlScene") {
|
||||
QString tmpPath = m_projectPath.toString() + "/" + m_projectFile;
|
||||
emit playQmlScene(tmpPath);
|
||||
setFullContentPath(tmpPath);
|
||||
setType("qmlScene");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user