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 video.currentTime = continueTimecode
} }
function enterFullscreen(event) { function enterFullscreen(event) {
video.requestFullscreen().catch(err => { if (video.webkitEnterFullScreen) {
console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`); video.webkitEnterFullScreen();
video.remove() } else {
}); video.requestFullscreen().catch(err => {
console.log(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
video.remove()
});
}
video.removeEventListener('play', enterFullscreen); video.removeEventListener('play', enterFullscreen);
setTimeout(() => { setTimeout(() => {
video.style.display = 'block' video.style.display = 'block'