Skip to content
Snippets Groups Projects
Unverified Commit e85ef52b authored by Greg Fodor's avatar Greg Fodor Committed by GitHub
Browse files

Merge pull request #731 from mozilla/bug/oculus-go-wrong-vr-display

Add oculus go workaround
parents a6f38464 85b0e9b5
No related branches found
No related tags found
No related merge requests found
......@@ -388,6 +388,14 @@ document.addEventListener("DOMContentLoaded", async () => {
if (availableVREntryTypes.isInHMD) {
remountUI({ availableVREntryTypes, forcedVREntryType: "vr" });
if (/Oculus/.test(navigator.userAgent)) {
// HACK - The polyfill reports Cardboard as the primary VR display on startup out ahead of Oculus Go on Oculus Browser 5.5.0 beta. This display is cached by A-Frame,
// so we need to resolve that and get the real VRDisplay before entering as well.
const displays = await navigator.getVRDisplays();
const vrDisplay = displays.length && displays[0];
AFRAME.utils.device.getVRDisplay = () => vrDisplay;
}
} else {
remountUI({ availableVREntryTypes });
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment