Skip to content

Conversation

@dmarcos
Copy link
Member

@dmarcos dmarcos commented Dec 16, 2018

navigator.getVRDisplays (WebVR) and navigator.xr.requestDevice (WebXR) are both asynchronous. An event makes easier to detect when a headset is connected and implement enter VR UIs / workflows.

device.supportsSession({immersive: true, exclusive: true}).then(function () {
var sceneEl = document.querySelector('a-scene');
vrDisplay = device;
if (sceneEl) { sceneEl.emit('headsetconnected', {vrDisplay: vrDisplay}); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just display

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used similarly to checkHeadsetConnected from utils

@ngokevin
Copy link
Member

r+wc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants