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

Android Chrome Version 56.0.2924.87 FullScreen Problem #27

Closed
halilcakar opened this issue Feb 14, 2017 · 16 comments
Closed

Android Chrome Version 56.0.2924.87 FullScreen Problem #27

halilcakar opened this issue Feb 14, 2017 · 16 comments

Comments

@halilcakar
Copy link

halilcakar commented Feb 14, 2017

After realise phaser-ce v2.7.3 i try to use fullScreenAPI on Android Chrome and it doesn't work for me,

if(game.scale.isFullScreen == false){
this.fullScreenButton.alpha = 0;
game.scale.startFullScreen(false);
} else {
game.scale.stopFullScreen();
this.fullScreenButton.alpha = 1;
}

By the way, the same codes works for phaser 2.6.2. I change and test it.
Can you guys check for it :)

@lewiji
Copy link
Contributor

lewiji commented May 23, 2017

Can confirm using game.scale.startFullScreen(); on a range of Android devices doesn't work, and throws the Phaser warning "Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture" even when initiated within an input handler callback.

@AnnaHui
Copy link

AnnaHui commented Jun 13, 2017

HI,
I have the same error message.

This is my example.
https://codepen.io/AnnaLiu/pen/EWJNPa?editors=0010

It cannot on fullscreen module on mobile device by touch the screen.
My phone is Android and I test it on Chrome 58-60 .

Thanks!

@halilcakar
Copy link
Author

Hi @AnnaHui ,
I just test with that link you gave us and it's working on desktop. on Mobile its not working at all. Tested at Android 6.0.1 - Chrome -V 58.0.3029.83

@AnnaHui
Copy link

AnnaHui commented Jun 13, 2017

Hi @halilcakarr ,
Yes, it is working on desktop, but not on mobile.

This is Phaser example:
https://phaser.io/examples/v2/display/fullscreen

It is not working on mobile, too.

Thanks!

@mdwelsh
Copy link

mdwelsh commented Jul 15, 2017

Hi folks, I'm an engineer on Chrome and am seeing this problem as well.

I filed this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=743315

It is not yet clear if this is a Chrome bug or not. I see that if I call game.scale.startFullScreen() from a regular onclick handler in a DOM element on the page (e.g., a button or a div) then it works. So it's possible that the input event that Phaser is capturing in game.input.onDown is not being recognized as a "user gesture" as required to allow a page to go full screen.

@lewiji
Copy link
Contributor

lewiji commented Jul 15, 2017

Thanks for your assistance. One thing I've noticed is this also happens on phaser 2.6.2 (ie not phaser ce) on some of our devices, where previously it worked on the same phaser version. So I suspect it's a chrome regression, though can't be certain.

@lewiji
Copy link
Contributor

lewiji commented Jul 18, 2017

From the issue:

"This sounds like https://docs.google.com/document/d/1oF1T3O7_E4t1PYHV6gyCwHxOi3ystm0eSL5xZu7nvOg/edit#heading=h.qq59ev3u8fba, an intentional security tightening that shipped in M56. For any intervention, some developer pain is expected in order to force them to move to best practices, and since this has been in stable for 3 releases already, it seems this pain is tolerable and most developers have already adapted. So I'll tentatively close as working as intended."

"It depends on the exact event they're triggering on. It looks like this JS is going fullscreen on "pointerdown". According to Rick's doc, that no longer works as of M56 -- I believe it should work if it changes to "pointerup" instead."

From my tests using onTap for example seems to work, whereas I was using onDown before. Probably the example should be updated to not use onDown just to ensure compatibility with Android devices.

@samme
Copy link
Collaborator

samme commented Jul 25, 2017

WICG/interventions#13

@samme
Copy link
Collaborator

samme commented Jul 29, 2017

Related: #37, #92

@samme
Copy link
Collaborator

samme commented Aug 17, 2017

@halilcakarr @lewispollard @AnnaHui Please see the conditions noted in Phaser.ScaleManager#startFullScreen and test again?

https://phaser.io/examples/v2/display/fullscreen will likely fail on recent Chrome because it uses game.input.onDown, which Chrome doesn't consider a user gesture.

@samme
Copy link
Collaborator

samme commented Sep 8, 2017

https://codepen.io/samme/pen/dzBZzm works for me, please reopen if you still see the problem.

@samme samme closed this as completed Sep 8, 2017
@Weedshaker
Copy link
Contributor

Weedshaker commented Sep 8, 2018

Actually, this is still a problem with chrome (68) on ios (11.4.1). @samme , Your demo above won't work and placing the "game.scale.startFullScreen()" into an onclick directly on a link on the page, still would refuse to go to fullscreen. Has anybody had the same issue? Can we reopen this issue? Or do you want a new issue for ios?

@samme
Copy link
Collaborator

samme commented Sep 8, 2018

@Weedshaker do you know if Chrome/iOS supports fullscreen at all?

@Weedshaker
Copy link
Contributor

@samme, I can 100% assure, that it used to work with chrome/ios and safari/ios. since I used to test the game with those browsers less than a year ago.

@lewiji
Copy link
Contributor

lewiji commented Sep 9, 2018

I'm not sure about this, we have never been able to use the fullscreen API on iOS as far as I know due to Apple's restrictions.

Edit: see: https://caniuse.com/#search=fullscreen

(iOS Safari includes iOS Chrome as they use the same engine under the hood)

@Weedshaker
Copy link
Contributor

Weedshaker commented Sep 9, 2018

Look I maybe could be wrong, cause I haven't regularly tested the game on mobile. Though, I was pretty confident, that I used to play it in fullscreen. Still, if none of you guys has had that experience, I must be wrong, and I maybe did setup the page to hide any other elements obscuring the view, so that it looked like fullscreen. Anyways, code wise, as Phaser is using it, it looks correct by this standard & vendor prefixes: https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen

Sorry guys for steering up the pot.

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

6 participants