Web XR current status

Hey @trevordev!

I’ve been working for a few days now on trying to get a web xr demo going ,but with no large success.

I’ve been testing on my samsung galaxy s3 tablet which has ARCore support.

I’ve tried with
Chrome 72
Chrome Dev
Chrome Canary

all with the xr flags enabled via chrome://flags

I’ve done some remote debugging via usb cable and have been able to call some of the navigator.xr
functions, but they have changed quite a lot since you last updated the XR stuff.

This is what I get from Chrome Dev now

ondevicechange: (...)
requestSession: ƒ ()
supportsSessionMode: ƒ ()

before when you requested a session you would do so with

  immersive: true,

But now you pass a {mode: 'immersive-ar' }

type XRSessionMode =
     * The default mode when requesting a session, but can be explicitly specified with the 'inline' enum value.
     * Inline sessions do not have the ability to display content on the XR device,
     * but may be allowed to access device tracking information and use it to render content on the page.
     * (This technique, where a scene rendered to the page is responsive to device movement,
     * is sometimes referred to as "Magic Window" mode.) UAs implementing the WebXR Device API must guarantee that inline sessions can be created,
     * regardless of XR device presence, unless blocked by page feature policy.
    'inline' |

     * Requested with the mode enum 'immersive-vr'.
     * Immersive VR content is presented directly to the XR device (for example: displayed on a VR headset).
     * Immersive VR sessions must be requested within a user activation event or within another callback that has been explicitly indicated to allow immersive session requests.
     * It should be noted that an immersive VR session may still display the users environment like an immersive AR session, especially on transparent displays
    'immersive-vr' |

     * Immersive AR content functions largely the same as immersive VR content,
     * with the primary difference being that it guarantees that the users environment will be visible and aligned with the rendered content.
     * This may be achieved with see-through displays, like HoloLens or Magic Leap, or video passthrough systems like ARCore and ARKit.
     * Additionally, access to environmental data (such as hit testing) may be permitted.
     * As with immersive VR, immersive AR sessions must be requested within a user activation event or another callback that has been explicitly indicated to allow immersive session requests.

When I try calling the supportsSessionMode('immersive-ar') i get aDOMException` which isn’t very helpful, so I’m guessing I’m too early and this isn’t supported yet.

I thought an update might be of use to you, so you don’t have to do the same work :slight_smile:

Going forward

I’m waiting for my acceptance to the firefox nightly ios program, since firefox has implemented the latest draft.
As soon as I have more info, i’ll post an update.

Adding @trevordev

Hey @Leon, yea the implementation is a bit out of date, it targets a version of chrome canary from early January (it should work if you have an apk). It’s hard to figure out what to target at the moment (firefox, polyfill, chrome chanary) and it is unclear to me how to find which spec which implements so I’ve been holding off until I have an implementation/spec that is more final.

Where did you find this news? If that is the case I can try to get into that aswell and try to update babylon’s code.

1 Like

I installed all the chrome versions directly from the app store.
They seem to keep getting updated, so I don’t think I need to install from an .apk?

It might just be that my samsung tablet doesn’t work yet.
Maybe it would work better if I had one of the google phones, which I would guess google uses for testing…

I read about firefox here: Can I use... Support tables for HTML5, CSS3, etc

Available and enabled by default only in Firefox Windows. Enabled in Nightly for iOS. Work in progress for GNU/Linux.

I still don’t have access to the beta program for iOS, but i’m hoping I’ll get added soon.

I think I have a spare samsung S8 lying around, I’ll give that a go and see if the phone works better than the tablet.

Yea I was using a pixel 2 XL when I managed to get it to work. The support table there is incorrect, it looks like its webVR support instead of webXR as Edge does not have any webXR support yet. I think the spec and implementations are still in flux so waiting still might be the best option but do let me know if you find a browser that targets the latest spec.

I’ll keep you posted of my findings :slight_smile:

i have a Pixel2 and S8 if you wanted me to test anything. cheers.