I haven't nailed down why this is happening, but these events are not being fired. This issue affects Firefox only.
I tested this in Firefox 45.0 -- but I suspect this is happening in other versions also.
Here is a minimum test case with jQuery that will reproduce the issue:
function onEnterFullscreen() {
alert("I don't fire in Firefox!");
}
function onExitFullscreen() {
alert("I also don't fire in Firefox!");
}
$('#photo-demo img').on('click', function() {
if (BigScreen.element !== this) {
BigScreen.request(this, onEnterFullscreen, onExitFullscreen);
}
else {
BigScreen.exit();
}
});
I've tried to write a unit test to reproduce this issue, however the Unit Tests do not actually activate the Fullscreen API because use of the Fullscreen API requires User Interaction.
It is possible to simulate User Interaction with sendEvent in PhantomJS, but other browsers will require an some sort of event handler. I haven't found a way to tell the browser that it's okay to allow Fullscreen API requests without User Interaction.
For my purposes, I'm just going to use an onclick handler and make the test pass and use the resulting lib for my project. However, I'm wondering what solution you'd like me to implement so that the Unit Tests are actually testing the Fullscreen API. Do you use any CI tools? Is an onclick handler acceptable? Can I simulate User Interaction with PhantomJS for the CI tests if there are any?
Thanks!
I haven't nailed down why this is happening, but these events are not being fired. This issue affects Firefox only.
I tested this in Firefox 45.0 -- but I suspect this is happening in other versions also.
Here is a minimum test case with jQuery that will reproduce the issue:
I've tried to write a unit test to reproduce this issue, however the Unit Tests do not actually activate the Fullscreen API because use of the Fullscreen API requires User Interaction.
It is possible to simulate User Interaction with sendEvent in PhantomJS, but other browsers will require an some sort of event handler. I haven't found a way to tell the browser that it's okay to allow Fullscreen API requests without User Interaction.
For my purposes, I'm just going to use an onclick handler and make the test pass and use the resulting lib for my project. However, I'm wondering what solution you'd like me to implement so that the Unit Tests are actually testing the Fullscreen API. Do you use any CI tools? Is an onclick handler acceptable? Can I simulate User Interaction with PhantomJS for the CI tests if there are any?
Thanks!