Skip to content
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

requestSession fails on iPad OS 13 #140

Open
WoodNeck opened this issue Feb 14, 2020 · 0 comments
Open

requestSession fails on iPad OS 13 #140

WoodNeck opened this issue Feb 14, 2020 · 0 comments

Comments

@WoodNeck
Copy link

WoodNeck commented Feb 14, 2020

Hello again, I found another issue.
If fullscreen API is supported in iOS devices, like iPad OS 13+ safari, requestSession will be rejected with the error "Unable to present";
Here's my explanation:

in iPad OS 13+, navigator.platform has following values.

  • Desktop mode: MacIntel
  • Mobile mode: iPad

which makes isIOS() returns true only for the mobile mode.

The problem is, polyfill creates a new canvas element when requestSession is called, like the following code, and uses it as a layer source for VRDisplay's requestPresent method.
image

VRDisplay's wrapForFullscreen is the only place where it wraps the canvas element with wrapper element and appends it to the body, but it won't if it's iOS environment.
image

So, it will call requestFullscreen for canvas before it is added to the document, so a fullscreen error will be triggered and requestSession will be rejected also.

One suggestion is least guaranteeing that the canvas is in the document when it's created.

I know there's no meaning in supporting iPad right now, but I guess when Fullscreen API lands on iOS someday it will be meaningful to do it.

Sorry for not preparing any demos.
I think this issue can be reproduced in https://naver.github.io/egjs-view360/panoviewer.html, until I release another version of it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant