Aframe: support WebXR Navigation permission

Created on 11 Feb 2020  路  8Comments  路  Source: aframevr/aframe

in new OculusBrowser there is navigation support for webxr

com oculus vrshell-20200210-225452

related https://github.com/immersive-web/navigation

Most helpful comment

wow! good catch! I would鈥檝e never expected to see navigation implemented so quickly. Oculus browser folks are doing an amazing job shipping experimental features. hat off 馃帺 to @Artyom17 and any other Oculus friends involved.

All 8 comments

wow! good catch! I would鈥檝e never expected to see navigation implemented so quickly. Oculus browser folks are doing an amazing job shipping experimental features. hat off 馃帺 to @Artyom17 and any other Oculus friends involved.

Yes, we have it experimentally implemented. Note, that the "Default" setting allows only certain well-known domains, so, most likely you need to switch to Enabled state to make it work for all domains.

@Artyom17 I was testing the sessiongranted event and It didn't work as I was expecting. I'm navigating to the same page url after entering VR mode (with navigation setting to Allowed)

window.location = "https://nova-childlike-leaf.glitch.me/

and I was expecting the event to fire:

 navigator.xr.addEventListener('sessiongranted', function (evt) {
    console.log('SESSION GRANTED');
 });

Full working example: https://nova-childlike-leaf.glitch.me/
and code: https://glitch.com/edit/#!/nova-childlike-leaf?path=index.html:10:9

Am I missing anything? Thanks

You need to call requestSession in the listener of sessiongranted.

navigator.xr.addEventListener('sessiongranted', onSessionGranted);

      function onSessionGranted() {
        console.log("onSessionGranted");
        onRequestSession();
      }

      function onRequestSession() {
        console.log("onRequestSession");
        return navigator.xr.requestSession('immersive-vr', {
            requiredFeatures: ['local-floor'] 
        }).then((session) => {
          xrButton.setSession(session);
          session.isImmersive = true;
          onSessionStarted(session);
        });
      }

An example code: https://github.com/Artyom17/webxr-samples/blob/gh-pages/tests/navigation.html

Working sample: https://artyom17.github.io/webxr-samples/tests/navigation.html

Actually, found a bug in my code that didn't allow to enable the XR navigation for any site. The fix is in the queue, the workaround is to switch the browser to single process mode via 'adb shell setprop debug.oculus.browser.singleproc 1' followed by 'adb shell am force-stop com.oculus.browser' commands. Note, the prop is not persistent and will be reset after reboot.
The issue will be fixed in OB 8.3

BTW, it was fixed a long time ago.

Awesome thanks. I鈥檒l try later

@dmarcos is there anything needed to change in aframe?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wlhm1984 picture wlhm1984  路  5Comments

impronunciable picture impronunciable  路  5Comments

greggman picture greggman  路  4Comments

jonikorpi picture jonikorpi  路  4Comments

beyerz picture beyerz  路  3Comments