-
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
Fire vrdisplayconnect on page load only if CardboardVRDisplay is used #303
Comments
Noticing the following in the WebXR spec, so maybe we're in the clear to call
|
From the latest WebXR Explainer:
The spec language isn't as explicit as is the Explainer text. Based on the excerpt above, I'd recommend to not fire Re: this As a developer, I liked the convenience of listening for an event on So, |
This is just for the 1.1 spec, though -- and with Firefox 59 now firing Good call on the WebXR issue filing! |
yeah, I thought about that. it’s probably best to be 1.1 compliant and not worry about the WebXR changes yet since there are no shipped implementations. so, 👍 to your proposal to fire the event, yes. |
Per conversation from Twitter with Ricardo and Kip, Firefox (until 59) did not fire a
vrdisplayconnect
on page load if a device was connected, however other browsers did. Previously, the polyfill had a similar behavior, but would even fire on a CardboardVRDisplay if it wasn't even used (#258). This was subsequently removed (dd56464).To achieve this functionality, we'll have to query to see if there are any native displays so we don't fire an event for a CardboardVRDisplay that won't be used (as the native VRDisplay will take priority), but @kearwood mentioned that [calling
getVRDisplays
could trigger UI],(https://twitter.com/kearwoodgilbert/status/951585714113671168). In the event native is not supported, this will be easy to just fire an event. But in the case where we have to query to see if any native displays exist, there's no way other than callinggetVRDisplays
AFAIK, other than maybe listening tovrdisplayconnect
on our own, but seems like an unavoidable race condition.Leaning towards calling
getVRDisplays
internally on load, and firevrdisplayconnect
forCardboardVRDisplay
if no native displays exist. Currently, no browsers have a UI for callinggetVRDisplays
, and with WebXR spec supporting only one device at a time, and moving towards that API, this should be a good enough solution. Thoughts? @cvan @kearwood @brianchirlsThe text was updated successfully, but these errors were encountered: