-
Notifications
You must be signed in to change notification settings - Fork 323
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
vrdisplayconnect event fires on unused shim VRDisplay #258
Comments
FWIW, the experimental Chromium WebVR builds (and Firefox used to/should/will) fire
So, if we're going to follow the behaviour spec'd in the WebVR API v1.1, we should not fire it even after
When you say "native device," what are the scenarios in which you'd expect this to happen? If a native device is found, then the native WebVR API (i.e., It's a little tricky in the Cardboard case because the phone itself is the headset. So, the VR Display can't technically ever be "disconnected." If the active window loses focus, or the user switches to another app on the phone, I could see it being useful to fire an event. But that event wouldn't make sense to be @brianchirls, @klausw, @jsantell: Thoughts? |
First, regarding whether As for native display devices found later, I'm mostly thinking we should prepare for unknown devices and circumstances. That's kinda the whole point of using the web. But more specifically, @klausw told me that Google VR Services will provide either a Cardboard display or Daydream, depending on which devices the user has selected in the global settings. And there won't be any display provided if Google VR Services are not installed. I don't know what the browser does if you install the service or change the setting while the page is loaded. But we should be prepared to handle it gracefully and allow for changes in the browser's behavior in the future as well as different behaviors from other browsers/devices that may show up later. |
@klausw: can you provide an update here of expected behaviour? |
The event fires on a shim
CardboardVRDisplay
as soon as it's created, even though it may not be used. After the display is created, we may detect a natively implemented Cardboard (or other) device. If that happens, the shim display will not be included in the list of displays returned bygetVRDisplays
.I propose the following:
getVRDisplays
promise is resolved and either there are no other displays orALWAYS_APPEND_POLYFILL_DISPLAY
is true.vrdisplayconnect
or fromgetVRDisplays
, disconnect the shim Cardboard, firevrdisplaydisconnect
and set any state accordingly (unless it's presenting!)vrdisplayconnect
Related to: #40, #244, #255
The text was updated successfully, but these errors were encountered: