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

support WebXR Navigation permission #4445

Closed
arpu opened this issue Feb 11, 2020 · 8 comments
Closed

support WebXR Navigation permission #4445

arpu opened this issue Feb 11, 2020 · 8 comments

Comments

@arpu
Copy link
Contributor

arpu commented Feb 11, 2020

in new OculusBrowser there is navigation support for webxr

com oculus vrshell-20200210-225452

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

@dmarcos
Copy link
Member

dmarcos commented Feb 11, 2020

wow! good catch! I would’ve 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.

@Artyom17
Copy link
Contributor

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.

@dmarcos
Copy link
Member

dmarcos commented Feb 25, 2020

@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

@Artyom17
Copy link
Contributor

Artyom17 commented Mar 5, 2020

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

@Artyom17
Copy link
Contributor

Artyom17 commented Mar 7, 2020

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

@Artyom17
Copy link
Contributor

Artyom17 commented May 2, 2020

BTW, it was fixed a long time ago.

@dmarcos
Copy link
Member

dmarcos commented May 2, 2020

Awesome thanks. I’ll try later

@arpu
Copy link
Contributor Author

arpu commented May 3, 2020

@dmarcos is there anything needed to change in aframe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants