Any Babylon way to toggling to fullscreen across devices

I’m trying to add a toggle to switch to fullscreen, in my app.

I am calling the scene.getEngine().switchFullscreen but I am wondering if Babylon already provides functionality to deal with all the fullscreen edge cases across the different platforms.

For example,
On the iPad, trying to move the camera (pulling down) comes out of fullscreen instead.
On iframe it doesn’t quite go fullscreen (probably depends on the parent container size, my bad).
On the iPhone it doesn’t seem to do anything, but would be cool to switch into fullscreen with optional landscape transition (similar to YouTube).

Anyone knows of a way to help with managing fullscreen?

Thanks

switchFullscreen is meant to do that. @RaananW might know more about some of the issues you are facing ?

1 Like

iOS and fullscreen…

Apple doesn’t support the fullscreen API, so there is little to do here sadly. the iPad issue is interesting though. I guess it is the gesture to leave fullscreen and there is little we can do about it because it is on the browser level and i doubt they will let us override this.

Apple should fix their browser. Or at least support web standards.

** just a PS - we do use webkitFullscreen under the hood if it is available, so there is nothing to do on your side.

2 Likes

I see… this helps a lot as I was already spending some time figuring out how to disable some of the browser gestures.

On the iPhone is there any easy support for pretending to be full screen by both rotating and hiding the top bar?
I’ll research another time :slight_smile:

By the way, Babylon is really well done and I’m loving working in it!

1 Like

I am sure there is a way to hide it. Does this work - html - How to hide Safari Mobile browser bottom button bar in iPhone? - Stack Overflow?

1 Like

Hahaha! Wishful thinking :grin:

1 Like

I haven’t found a way to hide the bar on the new iPhones/Safari, unfortunately.
Let me know if you do!

You can ask the user to install as PWA and then you can be full screen.

1 Like