Testing Defos module for html game.
FullScreen works very well on desktop, but does not work
for me on browsers on Android. Is there any solution for this ?
I am pretty sure that browsers do not allow a game to go fullscreen without user interaction, which means that you can’t do it automatically on game start, but instead have to do it when the user interacts with your game.
If you check the documentation it mentions that “On HTML5, this only works from defos.on_click() or defos.on_interaction().”
Yes, that’s right. I read the specification. I am testing an example from the module. And as I wrote, it works for the browser on the desktop, but does not work for the browser on the phone.
Which browser are you testing? Fullscreen mode is not available on iPhones as far as I can tell:
@britzl I’m testing on Chrome and FF on Android (Samsung s21). I know that fullscreen does not work on IOS
Could you please share how you are toggling fullscreen through code?
I would suggest that you change from on_click
to on_interaction
since on_interaction
triggers on click, keyup and touchend while on_click
only triggers on click:
And since you are testing on mobile it should be touchend that triggers and nothing else… (unless the browser translates a touchend to click under the hood)
Ok, I’ll be testing soon. Thank you !