fullscreen api is not working in ios safari and chrome. I am trying to show a image in full screen but its not working in ios safari, could anyone help me on the same. Am i using the right property of document.
function getBrowserFullscreenElementProp() {
if (typeof document.fullscreenElement !== "undefined") {
return "fullscreenElement";
} else if (typeof document.mozFullScreenElement !== "undefined") {
return "mozFullScreenElement";
} else if (typeof document.msFullscreenElement !== "undefined") {
return "msFullscreenElement";
} else if (typeof document.webkitFullscreenElement !== "undefined") {
return "webkitFullscreenElement";
} else {
throw new Error("fullscreenElement is not supported by this browser");
}
}
Tried
function getBrowserFullscreenElementProp() {
if (typeof document.fullscreenElement !== "undefined") {
return "fullscreenElement";
} else if (typeof document.mozFullScreenElement !== "undefined") {
return "mozFullScreenElement";
} else if (typeof document.msFullscreenElement !== "undefined") {
return "msFullscreenElement";
} else if (typeof document.webkitCurrentFullScreenElement !== "undefined") {
return "webkitCurrentFullScreenElement";
} else {
throw new Error("fullscreenElement is not supported by this browser");
}
}
As per can i use: Safari for iPhone does not support the fullscreen API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With