Phaser fullscreen latest news for safari?

Hi @samme and everyone…

I am using

this.game.scale.startFullscreen();

This works fine on chrome/firefox. But on Mac safari, it says fullscreen failed . I am starting to wonder why this happens, because in the docs, it says that this function uses plain Fullscreen API. So By looking at FullScreen API, it’s possible to go into fullscreen via prefix such as webkitRequestFullscreen on safari.

  1. Does this mean that phaser’s startFullScreen doesn’t use prefixes at all and just uses FullScreen API without prefixes?

  2. If that’s so, what do I do to make it work on mac/ios safari ?

That sounds like the browser refused to start fullscreen.

@samme

Yeah, so What i mean is I am using

this.game.scale.on('fullscreenfailed', () => {
            console.log("Full Screen Failed");
   })

So this is what gets called on Mac Safari. But the question is why? If I use elem. webkitRequestFullScreen() , full screen works just fine on Mac Safari …

I am wondering what Phaser’s startFullScreen() does and if it’s using vendor prefixes for different browsers.

I would focus on how you’re calling startFullscreen.

If Safari is refusing to start fullscreen, it doesn’t matter which un/prefixed method is used.

I am calling it like this:

this.game.scale.startFullscreen();

What else should be there to call this differently?

I don’t have a Safari to check, but you could test this example…

I guess browsers don’t ike “auto-fullscreen” for security reasons or under some conditions.
Just some ideas:

  • Try using anything interactive to launch the fullscreen (button ?)
  • If you are using an iframe try “allowfullscreen” prop

This doesn’t work on safari.

Funny thing is If i use FullScreen Api directly, It works even on safari. :smiley:

Phaser uses the prefixed names if necessary. You can look in game.device.fullscreen.