I know WebGL for mobile is not officially supported, but I am having quite good success with this anyway when being mindful to all limitations and frequently testing on various handsets.
Is there a good way to enable full screen mode on iPhone / iPad? Screen.fullscreen does not work, also the HTML based fullscreen button does not work on iOS (works on Android though).
Thank you for this link. So, looks like iOS just doesnt support fullscreen… That is too bad, my project really relies on this as we want to target VR on mobile through web, and then we need to make sure the content is aligned with the carboard or other VR glasses the user has… :S
I Tested on Chrome and Firefox on Android. Both have no issues with fullscreen.
But, even if it is not possible to have true fullscreen, it would be useful to let the container with the Unity player resize automatically using style sheets or the proper HTML parameters?
You can use the browser communication to have JavaScript call functions inside unity, and unity call functions in the JavaScript. Using this, you can use the JavaScript to determine the size of the browser window, and resize the unity player appropriately.
in addition, I had an object in Unity called WebpageComm which handled all communication from the javascript on the page. When running the above javascript, I also called something along the lines of…
which in turn calls those functions on the object in unity. In the UpdateWidth and UpdateHeight functions, I changed the player resolution so it would match the size of the player in the browser.
Hello! Does anyone have an answer to this problem? I see that on Safari iOS and Chrome iOS, Youtube fullscreen works. A Unity WebGL inside a page can’t do the same?
You can more or less do this if you have the user add your website to their home screen. This is what Google Stadia does for iOS — and it lets users play games full-screen on iOS via Safari. It’s just they have to add to homescreen & launch from homescreen first.