mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-26 15:51:51 +01:00
fix fullscreen bug with safari
This commit is contained in:
parent
2b240c8155
commit
79e4a689e0
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user