mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fix weird fullscreen enter/exit event on the web
This commit is contained in:
parent
2b005d6ea5
commit
e921095226
@ -63,7 +63,7 @@ const mapData = (
|
|||||||
fonts: info?.fonts,
|
fonts: info?.fonts,
|
||||||
previousSlug,
|
previousSlug,
|
||||||
nextSlug,
|
nextSlug,
|
||||||
qualitiesAvailables: !!data.links.hls
|
qualitiesAvailables: !!data.links.hls,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -89,9 +89,9 @@ export const Player = ({ slug, type }: { slug: string; type: "episode" | "movie"
|
|||||||
const setFullscreen = useSetAtom(fullscreenAtom);
|
const setFullscreen = useSetAtom(fullscreenAtom);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (Platform.OS !== "web") return;
|
if (Platform.OS !== "web") return;
|
||||||
if (!/Mobi/i.test(window.navigator.userAgent)) setFullscreen(true);
|
if (/Mobi/i.test(window.navigator.userAgent)) setFullscreen(true);
|
||||||
return () => {
|
return () => {
|
||||||
setFullscreen(false);
|
if (!document.location.href.includes("/watch")) setFullscreen(false);
|
||||||
};
|
};
|
||||||
}, [setFullscreen]);
|
}, [setFullscreen]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user