From 218a14d5f6a72eea95453a233d8c53784d2fcf26 Mon Sep 17 00:00:00 2001 From: Jelle van Snik Date: Sun, 8 Jan 2023 16:23:42 +0100 Subject: [PATCH] fullscreen video --- src/components/video/VideoContext.tsx | 3 +- src/components/video/VideoPlayer.tsx | 14 +++++-- .../video/controls/FullscreenControl.tsx | 39 +++++++++---------- .../video/controls/PauseControl.tsx | 10 +++-- src/components/video/hooks/controlVideo.ts | 17 +++++++- src/components/video/hooks/useVideoPlayer.ts | 29 +++++++++++--- src/views/TestView.tsx | 12 +++--- 7 files changed, 84 insertions(+), 40 deletions(-) diff --git a/src/components/video/VideoContext.tsx b/src/components/video/VideoContext.tsx index bc1bedea..bf8d4e95 100644 --- a/src/components/video/VideoContext.tsx +++ b/src/components/video/VideoContext.tsx @@ -53,8 +53,9 @@ export const VideoPlayerDispatchContext = createContext< export function VideoPlayerContextProvider(props: { children: React.ReactNode; player: MutableRefObject; + wrapper: MutableRefObject; }) { - const { playerState } = useVideoPlayer(props.player); + const { playerState } = useVideoPlayer(props.player, props.wrapper); const [videoData, dispatch] = useReducer( videoPlayerContextReducer, initial diff --git a/src/components/video/VideoPlayer.tsx b/src/components/video/VideoPlayer.tsx index d1b7f341..1dddbb1f 100644 --- a/src/components/video/VideoPlayer.tsx +++ b/src/components/video/VideoPlayer.tsx @@ -9,7 +9,7 @@ const VideoPlayerInternals = forwardRef((_, ref) => { const video = useContext(VideoPlayerContext); return ( -