Hi, I’m working in a really simple addon for Firefox Android and I can’t make it work by calling mozRequestFullScreen in an EventListener(‘load’)
It works fine by using ‘click’ though.
I understand that Fullscreen needs a user input in order to make it work due to some policies, but from my understanding and previous experience with other addons, automatic fullscreen is possible when the user decides to install an Addon.
Here’s the code:
function toggleFullScreen() {
if (!document.mozFullScreen) {
if (videoElement.mozRequestFullScreen) {
videoElement.mozRequestFullScreen();
}
} else {
if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
}
}
}
window.addEventListener("load", function(e) {
videoElement.mozRequestFullScreen();
}, false);
window.addEventListener("click", function(e) {
toggleFullScreen();
}, false);
Thank you!