Skip to content
Snippets Groups Projects
Commit 9295157c authored by Greg Fodor's avatar Greg Fodor
Browse files

Add oculus go hack

parent b55c009d
No related branches found
No related tags found
No related merge requests found
...@@ -388,6 +388,14 @@ document.addEventListener("DOMContentLoaded", async () => { ...@@ -388,6 +388,14 @@ document.addEventListener("DOMContentLoaded", async () => {
if (availableVREntryTypes.isInHMD) { if (availableVREntryTypes.isInHMD) {
remountUI({ availableVREntryTypes, forcedVREntryType: "vr" }); remountUI({ availableVREntryTypes, forcedVREntryType: "vr" });
if (AFRAME.utils.device.getVRDisplay().displayName.indexOf("Cardboard") >= 0) {
// HACK - Oculus Go sometimes reports Cardboard as the primary VR display on startup
// and that is cached by A-Frame, so we need to resolve that before entering as well.
const displays = await navigator.getVRDisplays();
const vrDisplay = displays.length && displays[0];
AFRAME.utils.device.getVRDisplay = () => vrDisplay;
}
} else { } else {
remountUI({ availableVREntryTypes }); 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