You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB
PHTML

<div id="cinemaContainer" hidden>
<video id="cinemaBox" controls>
<source src="resources/video/placeHolder0.webm" type="video/webm">
Video is not supported by your browser
</video>
<div id="skip" class="button"><img src="resources/img/fast-forward.png" alt="Přeskočit video"></div>
<div id="close" class="button"><img src="resources/img/x.png" alt="Exit"></div>
</div>
<script>
const video = document.querySelector('video')
const cinema = document.querySelector('#cinemaContainer')
const skipButton = document.querySelector("#skip")
video.onended = function(e){
if (document.fullscreenElement) {
document
.exitFullscreen()
.then(() => console.log("Document Exited from Full screen mode"))
.catch((err) => console.error(err));
}
exit()
questionMode()
}
skipButton.addEventListener("click", (e) => {
if (document.fullscreenElement) {
document
.exitFullscreen()
.then(() => console.log("Document Exited from Full screen mode"))
.catch((err) => console.error(err));
}
console.log('Skipping the video!')
video.pause()
exit()
questionMode()
})
</script>