diff --git a/src/hub.js b/src/hub.js index 39cb6d97e42b26809be549c2d7262a9ebd489514..2d3863f11d8354d72b4eab52967b1193063b8374 100644 --- a/src/hub.js +++ b/src/hub.js @@ -444,10 +444,10 @@ const onReady = async () => { } getAvailableVREntryTypes().then(availableVREntryTypes => { - if (availableVREntryTypes.gearvr === VR_DEVICE_AVAILABILITY.yes) { - remountUI({ availableVREntryTypes, forcedVREntryType: "gearvr" }); - } else if (availableVREntryTypes.isInHMD) { + if (availableVREntryTypes.isInHMD) { remountUI({ availableVREntryTypes, forcedVREntryType: "vr" }); + } else if (availableVREntryTypes.gearvr === VR_DEVICE_AVAILABILITY.yes) { + remountUI({ availableVREntryTypes, forcedVREntryType: "gearvr" }); } else { remountUI({ availableVREntryTypes }); } diff --git a/src/utils/vr-caps-detect.js b/src/utils/vr-caps-detect.js index 58023becc83d428d1d89f8c80878897d37da66b5..baed879b07a360c1e5d095b760912ff83ed3edfc 100644 --- a/src/utils/vr-caps-detect.js +++ b/src/utils/vr-caps-detect.js @@ -46,12 +46,12 @@ export async function getAvailableVREntryTypes() { const ua = navigator.userAgent; const isSamsungBrowser = browser.name === "chrome" && /SamsungBrowser/.test(ua); const isOculusBrowser = /Oculus/.test(ua); - const isFirefoxReality = /Firefox Reality/.test(ua); - const isInHMD = isOculusBrowser || isFirefoxReality; // This needs to be kept up-to-date with the latest browsers that can support VR and Hubs. // Checking for navigator.getVRDisplays always passes b/c of polyfill. const isWebVRCapableBrowser = window.hasNativeWebVRImplementation; + const isFirefoxReality = window.orientation === 0 && "buildID" in navigator && isWebVRCapableBrowser; + const isInHMD = isOculusBrowser || isFirefoxReality; const isDaydreamCapableBrowser = !!(isWebVRCapableBrowser && browser.name === "chrome" && !isSamsungBrowser); const isIDevice = AFRAME.utils.device.isIOS();