FormularSumo / Galaxy-Collection-Web

Love.JS Web port of https://github.com/FormularSumo/Galaxy-Collection hosted on GitHub Pages
https://formularsumo.github.io/Galaxy-Collection-Web/
GNU Affero General Public License v3.0
2 stars 0 forks source link

iOS can't go fullscreen unless installed as a web app #8

Closed FormularSumo closed 2 months ago

FormularSumo commented 2 months ago

Apple/Safari refuse to support fullscreen except for video playback on iOS (but not iPadOS, or macOS, or VisionOS?). Given they also prohibit all other browser engines on iOS, this is an effective ban on fullscreen apps/games. The only sliver lining is that "homescreen apps" (PWAs, or simply web apps) are allowed to, and this works fine. Unfortunately Apple hide the button to install PWAs near the bottom of the "Share" menu (because obviously it belongs there..) (also forced upon all other browsers), meaning the majority of users don't actually know how to do this (around 6/10 don't from what I've heard).

Hopefully this'll change when other browser engines are allowed and available on iOS (due to EU, UK and other regulators), or if Apple ever get round to figuring out how fullscreen works (been in iOS betas since 17.4). The best thing I can do is to remove the fullscreen button when requestFullscreen (and webkit/moz versions) are unsupported.

When other browser engines do ship on iOS, if Safari still doesn't support this, might be worth having a pop-up suggesting the user use another browser. This would be sensible I think as iOS Safari also has a lot of other major issues including failing to save user data and seriously bad performance, which no other modern browsers seems to.

FormularSumo commented 2 months ago

After too much time, I've got feature detection working, so the fullscreen button is hidden and the game doesn't attempt to automatically go into fullscreen if your browser doesn't support it. Going to mark this as closed for now as it should sort itself out once Apple ship requestFullscreen or other browsers engines are able to ship.

Potential use different browser prompt can wait until other problems have been investigated more thoroughly and either sorted out or reported, and to see what the situation's like when some kind of Fullscreen API hits iOS. That would likely be a separate issue to this one anyway.

FormularSumo commented 2 months ago

Side note: iOS was randomly getting crash screens sometimes (normally fixed by toggling between desktop/mobile site), and seems to never properly clear the site data which makes testing and fixing things so hard (especially not having Safari on desktop.. Gnome Web does not have most of these issues despite being Webkit based). But now the crash screens seem gone at least so that's good.

FormularSumo commented 1 month ago

Given that videos are allowed to go fullscreen, maybe it'd be possible to render the canvas to a video element and request fullscreen on that? Sounds like a pretty hacky workaround though..

FormularSumo commented 1 month ago

See https://github.com/danrossi/canvas-pip-fullscreen/blob/main/src/CanvasFullscreen.js#L26 for an implementation of this