From 79e4a689e031e6b5c0fe992bd70549bd7014dab2 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Wed, 18 Oct 2023 17:14:59 +0200 Subject: [PATCH] fix fullscreen bug with safari --- src/components/player/display/base.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/player/display/base.ts b/src/components/player/display/base.ts index 5a34f64c..9a806daa 100644 --- a/src/components/player/display/base.ts +++ b/src/components/player/display/base.ts @@ -80,6 +80,11 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { handleBuffered(videoElement.currentTime, videoElement.buffered) ); }); + videoElement.addEventListener("webkitendfullscreen", () => { + isFullscreen = false; + emit("fullscreen", isFullscreen); + if (!isFullscreen) emit("needstrack", false); + }); } function unloadSource() { @@ -101,6 +106,8 @@ export function makeVideoElementDisplayInterface(): DisplayInterface { isFullscreen = !!document.fullscreenElement || // other browsers !!(document as any).webkitFullscreenElement; // safari + emit("fullscreen", isFullscreen); + if (!isFullscreen) emit("needstrack", false); } fscreen.addEventListener("fullscreenchange", fullscreenChange);