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

Add correct vrDisplay.isConnected check to checkHeadsetConnected() #2427

Merged
merged 3 commits into from Mar 8, 2017
Merged

Add correct vrDisplay.isConnected check to checkHeadsetConnected() #2427

merged 3 commits into from Mar 8, 2017

Conversation

frankolivier
Copy link
Contributor

Fixes #2426

Microsoft Edge doesn't report HMD orientation before requestPresent (for privacy reasons) which causes checkHeadsetConnected() to always return false; on Microsoft Edge, the 'Enter VR' button falls back to the fullscreen experience, and the content is not rendered in the HMD.

Fix it is to add a vrDisplay.isConnected check (if available) to get the correct answer from hardware.

@@ -7,6 +7,8 @@ var controls = new THREE.VRControls(dolly);
* orientation is available
*/
function checkHeadsetConnected () {
var vrDisplay = controls.getVRDisplay();
if (vrDisplay && vrDisplay.isConnected) { return vrDisplay.isConnected; }
Copy link
Member

Choose a reason for hiding this comment

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

Can we do? if (vrDisplay && vrDisplay.isConnected) { return true; }

Copy link

Choose a reason for hiding this comment

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

can't isConnected be false, though?

should this be

  if (vrDisplay && 'isConnected' in vrDisplay) { return vrDisplay.isConnected; } 

Copy link
Member

Choose a reason for hiding this comment

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

Sure! We can do that

Copy link
Member

Choose a reason for hiding this comment

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

Can we change to 'isConnected' in vrDisplay and it looks good.

Fixes #2426

Microsoft Edge doesn't report HMD orientation before requestPresent (for
privacy reasons) which causes checkHeadsetConnected() to always return
false
@frankolivier
Copy link
Contributor Author

done

@ngokevin ngokevin merged commit 08f2bfd into aframevr:master Mar 8, 2017
@ngokevin
Copy link
Member

ngokevin commented Mar 8, 2017

Thanks!

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.

None yet

4 participants