-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Support fullscreen on iOS #749
Comments
I'm convinced brim is the way to go with this issue. Just need to fix that wonky autoscaling thing! |
btw, is the `me.device.isMobile` still up-to-date in terms of UA matching ?
never heard about brim before, but it;s super nice ! I also had a super quick look at the source code, and although some issues are probably linked to iOS9, I could see (I think) where would potentially be the points of conflicts with melonJS : |
btw, what did you use to do the video? |
QuickTime Player! I just used the builtin screen recording. |
Oh, and I'm using the iOS Simulator (part of Xcode) for iOS9 testing, since I don't have iOS9 installed on my phone. (I used the simulator while developing Lovely Drive, too. I found that it's not bug-for-bug compatible with iOS. But if your code does not rely on bugs, the simulator is definitely good enough.) |
giving more thoughts about this one, this should definitely rather be added in the boilerplate, rather than melonJS itself :
|
See #740 and #747 for previous discussion.
iOS does not support the fullscreen API, like desktop browsers. Instead, it has a buggy hack that attempts to make the UI "minimal" in portrait orientation when a page is scrolled. (This was available in iOS7 as the
minimal-ui
viewport settings, but it's now long gone!)An additional problem is that the canvas autoscaling we use (which is kind of broken, anyway/needs to be replaced with a reactive resize) makes iOS9 fail to enter fullscreen mode in landscape orientation!
So that's two issues:
I found that adding a 1px-high div is the easiest workaround to fix the landscape issue. This tricks iOS into seeing that there is more content on the page than can fit with UI. And because we request
apple-mobile-web-app-capable
, iOS will enter fullscreen mode.I also tried brim. And though it works, it also causes chaos with our autoscaling! After rotating the mobile device with brim, the screen scaling will be way off. To correct the scale, you have to tap the top/bottom of the screen to show the UI then use brim's mask element to hide the UI again.
The text was updated successfully, but these errors were encountered: