1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add small curtain transition

This commit is contained in:
kelteseth 2018-08-25 00:43:23 +02:00
parent 9a3079a887
commit e6d047f4c1
3 changed files with 30 additions and 31 deletions

View File

@ -6,18 +6,19 @@
object-fit: fill;
overflow: hidden;
height: 100%;
background:black;
}
body, html{
margin: 0px;
padding: 0px;
overflow: hidden;
background:orange;
background:black;
}
</style>
</head>
<body>
<video id="videoPlayer" oncontextmenu="return false;" width="100%" height="100%" loop muted autoplay>
<source id="videoSource" src="https://www.aimber.net/walk.webm" type="video/webm" oncontextmenu="return false;" width="100%" height="100%"> Your browser does not support the video tag.
<source id="videoSource" src="" type="video/webm" oncontextmenu="return false;" width="100%" height="100%"> Your browser does not support the video tag.
</video>
</body>
</html>

View File

@ -65,33 +65,39 @@ Rectangle {
onLoadProgressChanged: {
print(loadProgress)
if (loadProgress === 100) {
timerShowDelay.start()
}
}
userScripts: [scriptPlayer]
onJavaScriptConsoleMessage: print(message)
settings.allowRunningInsecureContent: true
WebEngineScript {
id: scriptPlayer
injectionPoint: WebEngineScript.DocumentReady
worldId: WebEngineScript.MainWorld
sourceCode: {
return "var videoPlayer = document.getElementById('videoPlayer');
runJavaScript("var videoPlayer = document.getElementById('videoPlayer');
var videoSource = document.getElementById('videoSource');
videoSource.src = \"file:///" + mainwindow.fullContentPath + "\";
videoPlayer.load();"
videoPlayer.load();", function(result) { mainwindow.init(); timer.start()});
}
}
onJavaScriptConsoleMessage: print(message)
settings.allowRunningInsecureContent: true
}
Timer {
id: timerShowDelay
interval: 2000
id:timer
interval: 200
onTriggered: {
mainwindow.init()
curtain.opacity = 0
anim.start()
print("start")
}
}
Rectangle {
id:curtain
anchors.fill: parent
color: "black"
PropertyAnimation {
id:anim
property: "opacity"
target: curtain
from: "1"
to: "0"
duration: 300
}
}
}

View File

@ -137,18 +137,10 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
}
void MainWindow::init()
{
setOpacity(0);
#ifdef Q_OS_WIN
ShowWindow(m_worker_hwnd, SW_SHOWDEFAULT);
ShowWindow(m_hwnd, SW_SHOWDEFAULT);
ShowWindow(m_worker_hwnd, SW_SHOWDEFAULT);
#endif
setOpacity(0);
QPropertyAnimation* animation = new QPropertyAnimation(this, "opacity");
animation->setDuration(200);
//animation->setEasingCurve(QEasingCurve::OutCubic);
animation->setStartValue(0.0);
animation->setEndValue(1.0);
animation->start();
}
QString MainWindow::getApplicationPath()