Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen doesn't work in mobile phone #4355

Closed
ghost opened this issue Feb 10, 2019 · 8 comments
Closed

Fullscreen doesn't work in mobile phone #4355

ghost opened this issue Feb 10, 2019 · 8 comments

Comments

@ghost
Copy link

ghost commented Feb 10, 2019

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

@photonstorm
Copy link
Collaborator

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.

@ghost
Copy link
Author

ghost commented Feb 10, 2019

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

@pfdtravalmatic
Copy link

pfdtravalmatic commented Feb 12, 2019

Same here.

  • Chrome version 72.0.3626.96 using emulator and Phone with Android 7
  • Phaser experimental build 3.16.2 (c843939)

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.

@photonstorm
Copy link
Collaborator

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.

@SnipersCode
Copy link

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.

@ghost
Copy link
Author

ghost commented Feb 16, 2019

I get this error

MESSAGE: Uncaught TypeError: Cannot read property 'isFullscreen' of undefined

@photonstorm
Copy link
Collaborator

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.

@photonstorm
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants