[SOLVED] WebVR Starting Kit "WebXR not supported" while others WebXR demos are working in the same browser

I just tested successfully this WebVR demo with Firefox and my HTC Vive Pro.

image

The inputs are not well mapped on my Index Controller but that’s not the point.

The problem is when I start a new project with the VR Starter kit using the same browser (Firefox).

image

When I hit play, it shows a message saying that “WebXR is not supported” (using Firefox)

I tried in Chrome (with officially support WebXR) but sadly, Chrome is not compatible with HTC Vive Pro (it did not detect my HMD when trying to enter in VR, it’s seem compatible with mobiles HMD only).

What are my solutions here? Trying to duplicate the WebVR demo without using the VR starting kit?

Just to check, do the WebXR examples work on FF with your HMD? https://immersive-web.github.io/webxr-samples/

1 Like

Yes it is.

image

Also, this other experience is also working on FF with my HMD: https://mixedreality.mozilla.org/hello-webxr/

image

Is that will or without the polyfill out of interest @Mystik?

@max Is this something you can look at on desktop?

With polyfill, it’s working. :ok_hand:
Without polyfill, Firefox doesn’t detect my HMD:

I just tested with the new Firefox Reality for PC and the “WebVR starting kit” project still doesn’t work for me.

With this browser, I don’t have the message “WebXR not supported” but clicking (in VR) on the VR button just do nothing:

@max Is this something you can help with please?

The problem is how Playcanvas detect the capabilites of the browsers.

This function:

image

app.xr.supported return false on some browsers even if theses browsers are tested on other sites:

image

Same problem with this function:

//Return false on compatible browser
this.app.xr.isAvailable(pc.XRTYPE_AR) 

But wait! This is from the WebVR Starting Kit in debug mode. But with the same browser, I can test this UI example without problem: https://developer.playcanvas.com/en/tutorials/webxr-ray-input/

And guess what, this tutorial use the same code: this.app.xr.isAvailable(pc.XRTYPE_AR) ! Why it is working in this demo but not in the default WebVR project? Is this a problem testing in the play mode directly from the editor? Something else?

Can you post a link to the project that is not working (the WebVR project) please?

@yaustar Can you post a link to the project that is not working (the WebVR project) please?

Sure, it is just a brand new project created from your template: https://playcanvas.com/project/711292/overview/vr-starter-kit

image

Another test that you can do it to try with the lasted Chrome version on mobile. Same problem (WebXR not compatible in this project but demos in tutorials section of Playcanvas’s website and other WebXR demos are working).

Here another test related to this problem:

I just tested successfully this demo here with WebXR available (can go in AR or VR mode): https://developer.playcanvas.com/en/tutorials/webxr-ray-input/

I forked this project on my account. Played it from there (editor + debug play) and…WebXR not available.

How the WebXR availability can changes with the same browser/device and same projet but in different environment?

Oh wait! I think I have found the source of the problem. Testing the same project from a secured URL is working.

Is this possible that WebXR is available only on secured Website “HTTPS”? Edit: Yes it is!

If that so, can you consider adding a new verification (warning?) in your base project to help/inform other users about this requirement?

From Oculus documentation:

HTTPS is Required

The standard for WebXR requires that the API is only available to sites loaded over a secure connection (HTTPS). For production use, you will need to use a secure origin to support WebXR. If you don’t already support HTTPS, you can get started using Let’s Encrypt. For development purposes, Oculus Browser allows WebXR on localhost servers without a secure connection or SSL certificate.

From Mozilla documentation: developer.mozilla.org: Starting up and shutting down a WebXR session

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

1 Like

Ah yes, I’ve been bitten by this before. WebXR and WebVR APIs are not accessible over standard HTTP. Maybe we should update the examples with a warning? :thinking:

@yaustar:

Maybe we should update the examples with a warning?

I did it by adding this code in the same function that verify if WebXR is available.

if(window.location.protocol != "https:")
    {
        // WebXR is not supported on non https request
        this.buttonVr.enabled = false;
        this.elementUnsupported.element.text = "WebXR requires a secure connection (HTTPS).";
        this.elementUnsupported.enabled = true;
    }

Yeah, I was thinking of doing something similar

1 Like

Added to the WebXR starter kit now

1 Like

This issue seems to appear on Oculus devices (I’m using AirLink on a Quest 2). WebXR seems to fire up on Edge fine, but in Firefox 94.01 on Windows 10 Pro (now has native WebXR support) I get a “WebXR is not supported” in the Playcanvas “VR Starter Kit” demo. Mozilla Hubs, and other demos do indeed work, i.e. Hello WebXR! - Mozilla Mixed Reality

I’m running into similar issues here. Will write up some bug reports next week

1 Like

Created a ticket specific for the firefox question: https://github.com/playcanvas/engine/issues/3734

A quick look at the source code does suggest that it is using some sort of specific WebXR polyfill

1 Like