From d51603a3827f04192b04bbf42fa5761ab70b1a98 Mon Sep 17 00:00:00 2001 From: frost768 Date: Wed, 22 Mar 2023 12:38:12 +0300 Subject: [PATCH] fix safari fullscreen --- src/video/components/VideoPlayerBase.tsx | 2 +- src/video/components/internal/VideoElementInternal.tsx | 2 +- src/video/state/providers/videoStateProvider.ts | 4 +++- src/views/developer/VideoTesterView.tsx | 6 +++--- src/views/media/MediaView.tsx | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/video/components/VideoPlayerBase.tsx b/src/video/components/VideoPlayerBase.tsx index 18f34ab0..82d91dac 100644 --- a/src/video/components/VideoPlayerBase.tsx +++ b/src/video/components/VideoPlayerBase.tsx @@ -39,7 +39,7 @@ function VideoPlayerBaseWithState(props: VideoPlayerBaseProps) {
); } diff --git a/src/video/state/providers/videoStateProvider.ts b/src/video/state/providers/videoStateProvider.ts index 4b085133..7ea0e321 100644 --- a/src/video/state/providers/videoStateProvider.ts +++ b/src/video/state/providers/videoStateProvider.ts @@ -277,7 +277,9 @@ export function createVideoStateProvider( updateMediaPlaying(descriptor, state); }; const fullscreenchange = () => { - state.interface.isFullscreen = !!document.fullscreenElement; + state.interface.isFullscreen = + !!document.fullscreenElement || // other browsers + !!(document as any).webkitFullscreenElement; // safari updateInterface(descriptor, state); }; const volumechange = async () => { diff --git a/src/views/developer/VideoTesterView.tsx b/src/views/developer/VideoTesterView.tsx index 7681af6e..e3ee84f4 100644 --- a/src/views/developer/VideoTesterView.tsx +++ b/src/views/developer/VideoTesterView.tsx @@ -50,7 +50,7 @@ export function VideoTesterView() { if (video) { return ( -
+
@@ -64,8 +64,8 @@ export function VideoTesterView() { />
diff --git a/src/views/media/MediaView.tsx b/src/views/media/MediaView.tsx index b674fb9f..bad662ff 100644 --- a/src/views/media/MediaView.tsx +++ b/src/views/media/MediaView.tsx @@ -132,7 +132,7 @@ export function MediaViewPlayer(props: MediaViewPlayerProps) { } return ( -
+