fscreen
fscreen copied to clipboard
fullscreenEnabled is false for Safari and Chrome on iOS
Following the example app and found that on both Safari & Chrome iOS, fscreen.fullscreenEnabled is always false. The native API responds false as well so I don't think it's this package, any ideas on why this is? I am using a local HTTPS react server
Hey if anyone is still struggling with this issue, I found this thread on StackOverflow. Turns out this is an issue with IOS and other fullscreen libraries like screenful also don't do this check. Try doing this:
try {
// for most browsers, this will work
if (isFullscreenEnabled()) {
fscreen.requestFullscreen(element);
}
// for older versions of Safari and IOS, `isFullscreenEnabled` will return false even though it is supported https://stackoverflow.com/a/39083376/10626111
else if (
"webkitEnterFullScreen" in element &&
typeof element.webkitEnterFullScreen === "function"
) {
return element.webkitEnterFullScreen();
}
} catch (err) {
console.error("Failed to enter fullscreen:", err);
}