Fullscreen doesn't work in mobile phone
The full screen api doesn't seem to work in android phone. I used the example from https://labs.phaser.io/100.html?src=src\scalemanager\full%20screen%20game.js
Which browser? and which version of Android? Support is limited on mobile. If the device + browser don't support it, there's nothing that can be done.
Which browser? and which version of Android? Support is limited on mobile. If the device + browser don't support it, there's nothing that can be done.
Uh, Browser is chrome
And android versions are 6 and 8
Same here.
- Chrome version 72.0.3626.96 using emulator and Phone with Android 7
- Phaser experimental build 3.16.2 (c8439393fba69201634940e752df4ae965d7fa88)
Console output is two-fold:
Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture
and
Uncaught (in promise) TypeError: fullscreen error
I've done some investigation and it seems to occur in the function startFullscreen (specifically line 69015 in phaser.js:
fsTarget[fullscreen.request](fullscreenOptions);
Desktop seems to work fine. I've tried setting the fullscreenTarget to document.documentElement, as well as not setting it at all. Furthermore, I'm not able to get console outputs, but iPad+Safari and Mozilla Firefox emulator don't appear to work either.
iPad and iPhone work fine for me on real devices.
The Android issue is weird because it is coming from a user gesture in that demo. I could understand the error if it was being called automatically without a gesture.
I'm getting the same thing.
- iPhone 7S Plus
- iOS version 12.1.4
- iOS Safari
- Fullscreen API Experimental WebKit feature enabled
Pushing the fullscreen button changes the button to the "return to fullscreen" version, but nothing actually happens. The button then goes unresponsive and you can't switch it back to the "go to fullscreen" version.
I get this error
MESSAGE: Uncaught TypeError: Cannot read property 'isFullscreen' of undefined
Looking at this today. It's interesting. If you tap anywhere on the canvas first (before tapping the fullscreen button) and THEN tap the fullscreen button, it works perfectly. If the very first thing you do is tap the fullscreen button, it errors.
So, something appears to be getting in the way of the first tap, because the code path is identical. I'm guessing maybe the web audio unlocking.
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Please note the updated documentation + example regarding this feature on mobile.