safari is special

This commit is contained in:
j 2021-10-25 08:53:39 +01:00
parent cd74ed455d
commit 0577adffb8

View file

@ -30,10 +30,14 @@ document.querySelector('a#play-fullscreen').addEventListener('click', event => {
video.currentTime = continueTimecode
}
function enterFullscreen(event) {
if (video.webkitEnterFullScreen) {
video.webkitEnterFullScreen();
} else {
video.requestFullscreen().catch(err => {
console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
video.remove()
});
}
video.removeEventListener('play', enterFullscreen);
setTimeout(() => {
video.style.display = 'block'