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);
See the following 3 line code that doesn’t do nothing without user interaction, BUT, if you use it as an addon it works! This meaning installing addon = user interaction ¿?
Nope. You are simply using a completely different API without the user-interaction restriction (that also does something different, page fullscreen !== window fullscreen).
It would probably be nice to have a fullscreen property on tabs, though.