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

Enter VR button is not working on Android WebView #1940

Closed
andymartinwork opened this issue Sep 26, 2016 · 15 comments
Closed

Enter VR button is not working on Android WebView #1940

andymartinwork opened this issue Sep 26, 2016 · 15 comments
Labels
Milestone

Comments

@andymartinwork
Copy link

Description:

  • A-Frame Version: aframe-v0.3.0.js
  • Platform/Device: Android WebView
  • Reproducible Code Snippet or Demo URL [highly encouraged]:

A-Frame used to work fine in version 0.2.0
My app runs by default in fullscreen.

When I try clicking on the Enter VR button this error is output in the console:

a-scene.js:175 Uncaught (in promise) Error: Failed to enter VR mode (requestPresent): Unable to present.(…)enterVRFailure @ a-scene.js:175

@andymartinwork
Copy link
Author

Possibly related to: #1933

@andymartinwork
Copy link
Author

Also related to immersive-web/webvr-polyfill#114

@andymartinwork
Copy link
Author

andymartinwork commented Oct 2, 2016

This might be a tricky one. I have bypassed the fullscreen problem, then a problem with the orientation lock not being available on the webview.

The Enter VR mode button then disappears for the rest of the session, without leaving any console log.
Not really sure what to do with that one... Something is clearly not firing when it should be.

@oscarmarinmiro
Copy link

Just the same thing happens to me (same console output) + "Enter-VR" not possible in Chrome 4.2 on an Android LG 5. However with Chrome 4.3 (Beta) works ok...

@andymartinwork
Copy link
Author

I think that is because Chrome Beta supports the WebVR 1.0 spec and prod does not.

Eventually, the webview will support the spec, but there will still be problems with a-frame because of the fullscreen indicator and orientation lock code.

@mn-martin
Copy link

This is still broken in v0.4.0 and on the master branch. In v0.2.0 it was working perfectly.

@andymartinwork
Copy link
Author

0.4.0 has a nicer message: Uncaught (in promise) Error: Failed to enter VR mode (requestPresent): No VR hardware found.

@andymartinwork andymartinwork changed the title Enter VR button is not working on Android WebView on 0.3.0 Enter VR button is not working on Android WebView Jan 16, 2017
@andymartinwork
Copy link
Author

It didn't work because the calls to go into fullscreen failed, and then orientation lock. You can't control these things with javascript because they are app settings.
Both of them are in the correct settings of course. The fix here is to disable the fullscreen and orientation checks when in a webview. The same will apply to iOS.

@andymartinwork
Copy link
Author

This is because the WebView doesn't support vrDisplay, and aframe doesn't support browsers that don't support vrDisplay.

A potential fix is to use a-frame 0.2.0 code for presenting as a fallback.

@dmarcos
Copy link
Member

dmarcos commented Jan 28, 2017

Sorry, I don't understand the problem. Chrome (not the Chromium WebVR builds), Firefox (not Nightly), Edge or Safari don't support VRDisplay and a-frame works fine. The polyfill should kick in in all those cases. What's different in a webview?

@dmarcos
Copy link
Member

dmarcos commented Jan 28, 2017

We don't do Android development in the a-frame team so we cannot test webviews easily. If someone can investigate and provide a fix we will take it

@andymartinwork
Copy link
Author

andymartinwork commented Jan 28, 2017

Sorry, I'm not very familiar with the codebase. Where is the polyfill located?

Ahh, it seems to be in index.js - I will have a look into it.

@andymartinwork
Copy link
Author

OK, looks like a simple fix for the webvr-polyfill project. I will submit a pull request with them and keep this bug open to make sure we update the dependency on a-frame.

@andymartinwork
Copy link
Author

Hmm, it looks like the changes were submitted and denied. WTF.

immersive-web/webvr-polyfill#175

@ngokevin ngokevin added this to the 0.5.0 milestone Feb 1, 2017
@ngokevin
Copy link
Member

ngokevin commented Feb 7, 2017

#2345

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

No branches or pull requests

5 participants