How do I test if a tour is being viewed in any headset?
Subquestion: how do you test if that headset is using Google Cardboard?
Testing if viewing in headset
-
-
have a look at:
https://krpano.com/plugins/webvr/#ismobilevr
https://krpano.com/plugins/webvr/#isgearvr
https://krpano.com/plugins/webvr/#iswebvr
https://krpano.com/plugins/webvr/#isfakei use something like
function webvr_state() {
return krpano.webvr && krpano.webvr.isenabled ? krpano.webvr.isfake ? krpano.webvr.iswebvr ? 3 : 1 : 2 : 0;
}0=off, 1=fake, 2=mobile, 3=true webvr (oculus go, rift, etc)
google cardboard is 2, not sure about gearvr.. 2? 3? -
not sure about gearvr.. 2? 3?
I expect it would be 3 (true webvr) since isgearvr is true for gearvr and any Oculus hardware. I will have to play with this when I get back in town.Thanks!
-
I put together a page testing the various WebVR states. You can try it here: tdf360.com/test/webvr. Here is what I found (when WebVR is available, before you enter VR):
webvr.iswebvr == true only and always in a headset, at least on Gear VR, Go and probably other Oculus headsets. This is true even if you aren't in VR mode or if the VR browser is in desktop mode.
webvr.isgearvr == true only in a headset, at least on Gear VR, Go and probably other Oculus headsets. This is true even if you aren't in VR mode but is not true if the VR browser is in desktop mode. I hope someone can test this in other headsets.
So, if isgearvr is true iswebvr will also be true. It seems the only way to know if you are in a headset with the browser in vr mode (the default) is if isgearvr is true.
webvr.isfake == true only on desktops. (ismobilvr will also always be true on a desktop.)
webvr.ismobilevr == true means "cardboard" if webvr.isfakevr == false. This is true for my mobile devices (galaxy, iphone and ipad) regardless of browser. I don't think there is a way to tell if you are viewing in a cardboard headset.
Why is this important? I want to know if the tour is being viewed in a real VR headset so I can set appropriate splash dialog and screen options. For example clicking the start button alway drops you into VR. If someone really wants to view the non-VR version they can click the browser's desktop mode button. When dropping out of VR mode, which happens whenever you take off the headset[edit: on Gear VR but not GO], I want to be sure none of the desktop version starts showing and that you have a button to take you back into VR. That is something you wouldn't want on a desktop or device that isn't a headset.
Please Test: if others could share results on other headsets from HTC, Daydream, etc it would be appreciated. I'm especially curious if isgearvr and iswebvr are true in other headsets.
Sidenote: On a desktop , if you actually turn off FakeVR by setting plugin[webvr].mobilevr_fake_support = false, all the tests will show false except isWebVR will be true. No idea why.
-
That's really helpful Scott!
What's irritating is that the Pico headset reads as gearVR, webVR but not mobileVR. It does however read as mobile!! -
Remember that this test was built with v1.19.16. The current version may work a little differently.
Are you using the Pico G2 4K headset? What is your impression of image quality and performance?
-
Hi,
just as note - in 1.20 you can check the isvrbrowser setting:
https://krpano.com/plugins/webvr/#isvrbrowserBest regards,
Klaus
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!