Skip to content
Snippets Groups Projects
Verified Commit 83ca8896 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: initial support for safari fullscreen

parent 29694f15
No related branches found
No related tags found
No related merge requests found
Pipeline #1551 passed
......@@ -97,9 +97,14 @@ export const Display: FC<DisplayProps> = ({
// requests the browser to go fullscreen using the
// body of the document as the entry HTML element
nativeFullscreen &&
document.body.requestFullscreen &&
if (nativeFullscreen && document.body.requestFullscreen) {
document.body.requestFullscreen().catch(() => {});
} else if (
nativeFullscreen &&
(document.body as any).webkitRequestFullscreen
) {
(document.body as any).webkitRequestFullscreen();
}
} else {
setWidth(undefined);
setHeight(undefined);
......@@ -110,9 +115,14 @@ export const Display: FC<DisplayProps> = ({
// restores the window mode, returning from the
// fullscreen browser
nativeFullscreen &&
document.exitFullscreen &&
if (nativeFullscreen && document.exitFullscreen) {
document.exitFullscreen().catch(() => {});
} else if (
nativeFullscreen &&
(document as any).webkitExitFullscreen
) {
(document as any).webkitExitFullscreen();
}
}
return () => {
window.removeEventListener("resize", resizeRef.current);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment