1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix preview image missing if workshop item has no gif preview

This commit is contained in:
Elias Steurer 2021-02-05 11:46:04 +01:00
parent 555680f026
commit 80b6abc81d
2 changed files with 7 additions and 5 deletions

View File

@ -8,7 +8,7 @@
let html = document.getElementsByTagName('html')[0];
html.setAttribute('style', 'margin: 0px;padding: 0px;overflow: hidden;background:black;');
var videoElem = document.createElement('VIDEO');
var videoElem = document.createElement('video');
videoElem.setAttribute('width', '100%');
videoElem.setAttribute('height', '100%');
videoElem.setAttribute('id', 'video');

View File

@ -127,9 +127,11 @@ Drawer {
function getUpdateVideoCommand() {
let src = ""
src += "var videoPlayer1 = document.getElementById('video');\n"
src += "videoPlayer1.src = '" + root.videoPreview + "';\n"
src += "videoPlayer1.play();\n"
src += "var video = document.getElementById('video');\n"
src += "video.src = '" + root.videoPreview + "';\n"
// Incase a workshop item has no gif preview
src += "video.poster = '" + root.videoPreview + "';\n"
src += "video.play();\n"
return src
}