From a265daf6987944e8da0a1381c1a05b5afdd04652 Mon Sep 17 00:00:00 2001 From: Jibon Date: Thu, 28 Sep 2023 17:12:57 +0200 Subject: [PATCH] use `await` --- src/components/media-elements/videos/video/videoElm.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/media-elements/videos/video/videoElm.tsx b/src/components/media-elements/videos/video/videoElm.tsx index 5a56f33f..12b2e35a 100644 --- a/src/components/media-elements/videos/video/videoElm.tsx +++ b/src/components/media-elements/videos/video/videoElm.tsx @@ -57,7 +57,7 @@ const VideoElm = ({ track }: IVideoElmProps) => { setLoaded(true); }; - const fullScreen = () => { + const fullScreen = async () => { if (!document.fullscreenElement) { ref.current?.requestFullscreen().catch((err) => { alert( @@ -65,13 +65,13 @@ const VideoElm = ({ track }: IVideoElmProps) => { ); }); } else { - document.exitFullscreen(); + await document.exitFullscreen(); } }; const pictureInPicture = async () => { if (document.pictureInPictureElement) { - document.exitPictureInPicture(); + await document.exitPictureInPicture(); await sleep(500); } const el = ref.current;