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

Vive, Rift HMDs not being recognized in getDeviceByType_() #170

Open
beaucronin opened this issue Jan 2, 2017 · 3 comments · Fixed by immersive-web/webvr-polyfill#276 · May be fixed by gkatsev/webvr-polyfill#1
Open

Comments

@beaucronin
Copy link

With both Vive and Rift, on both Chromium 56.0.2902.0 and Firefox Nightly, the getDeviceByType_() function is not seeing the HMD and is returning null.

The problem seems to be that the instanceof check in this line is not returning true https://github.com/borismus/webvr-boilerplate/blob/master/src/webvr-manager.js#L139

This is happening even though there is indeed a VRDisplay object available (either Vive or Rift), and if I encourage the check to return true (by inspecting the VRDisplay.displayName property, for example), everything works fine. I have used a breakpoint to inspect the VRDisplay object, and to my eye it looks fine - I have no idea why the instanceof check is returning false.

For reference, my current patch for that line (which works with both systems, on both browsers), is this monstrosity:

if (displays[i] instanceof type || displays[i].displayName == "HTC Vive DVT" || displays[i].displayName.startsWith("Oculus")) {
@beaucronin beaucronin changed the title HMDs not being recognized in getDeviceByType_() Vive, Rift HMDs not being recognized in getDeviceByType_() Jan 2, 2017
@beaucronin beaucronin changed the title Vive, Rift HMDs not being recognized in getDeviceByType_() Vive, Rift HMDs not being recognized in getDeviceByType_() Jan 2, 2017
@alfa256
Copy link

alfa256 commented Jan 10, 2017

I'm experiencing the same issue, it only seems to work on chromium vr build for android.

@buesing
Copy link

buesing commented Feb 8, 2017

I can also reproduce this with the latest chromium build on windows (56.0.2910.0)

@gkatsev
Copy link

gkatsev commented Aug 17, 2017

I think the root cause is that enablePolyfill from webvr-polyfill runs even when it shouldn't.
https://github.com/googlevr/webvr-polyfill/blob/5f8693a9053ee1dea425e96d14cd1f2bef7a284c/src/webvr-polyfill.js#L39-L40
Seems to be caused by this commit: immersive-web/webvr-polyfill@7908ac4

gkatsev added a commit to gkatsev/webvr-polyfill that referenced this issue Aug 17, 2017
If you run the polyfill when native VR is available, you won't be able to put the player into VR mode properly. This should fix borismus/webvr-boilerplate#170 and videojs/videojs-vr#14
jsantell pushed a commit to immersive-web/webvr-polyfill that referenced this issue Sep 12, 2017
If you run the polyfill when native VR is available, you won't be able to put the player into VR mode properly. This should fix borismus/webvr-boilerplate#170 and videojs/videojs-vr#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants