mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
fix fullscreen bug with safari
This commit is contained in:
parent
2b240c8155
commit
79e4a689e0
1 changed files with 7 additions and 0 deletions
|
@ -80,6 +80,11 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
|
||||||
handleBuffered(videoElement.currentTime, videoElement.buffered)
|
handleBuffered(videoElement.currentTime, videoElement.buffered)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
videoElement.addEventListener("webkitendfullscreen", () => {
|
||||||
|
isFullscreen = false;
|
||||||
|
emit("fullscreen", isFullscreen);
|
||||||
|
if (!isFullscreen) emit("needstrack", false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function unloadSource() {
|
function unloadSource() {
|
||||||
|
@ -101,6 +106,8 @@ export function makeVideoElementDisplayInterface(): DisplayInterface {
|
||||||
isFullscreen =
|
isFullscreen =
|
||||||
!!document.fullscreenElement || // other browsers
|
!!document.fullscreenElement || // other browsers
|
||||||
!!(document as any).webkitFullscreenElement; // safari
|
!!(document as any).webkitFullscreenElement; // safari
|
||||||
|
emit("fullscreen", isFullscreen);
|
||||||
|
if (!isFullscreen) emit("needstrack", false);
|
||||||
}
|
}
|
||||||
fscreen.addEventListener("fullscreenchange", fullscreenChange);
|
fscreen.addEventListener("fullscreenchange", fullscreenChange);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue