Skip to content

Commit

Permalink
use await
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Sep 28, 2023
1 parent 122511e commit a265daf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/media-elements/videos/video/videoElm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ const VideoElm = ({ track }: IVideoElmProps) => {
setLoaded(true);
};

const fullScreen = () => {
const fullScreen = async () => {
if (!document.fullscreenElement) {
ref.current?.requestFullscreen().catch((err) => {
alert(
`Error attempting to enable full-screen mode: ${err.message} (${err.name})`,
);
});
} else {
document.exitFullscreen();
await document.exitFullscreen();
}
};

const pictureInPicture = async () => {
if (document.pictureInPictureElement) {
document.exitPictureInPicture();
await document.exitPictureInPicture();
await sleep(500);
}
const el = ref.current;
Expand Down

0 comments on commit a265daf

Please sign in to comment.