WonderlandEngine / emscripten-webxr

WebXR library for use with Emscripten.
MIT License
43 stars 5 forks source link

No WebXR API detected #4

Closed JsMarq96 closed 2 years ago

JsMarq96 commented 2 years ago

I am having some difficulties integrating this webxr to my webgl renderer, failing the webxr_init; and by diggin arround, it seems like there is no WebXR API detected.

For example, the navigator.xr returns null, like the device does not even have support for the API, but on other, pure JS samples, it returns an XRSystem object.

EDIT: Forgot to say, the error calback returns a -2. I suppose that I missed some setup, or something like that...

Squareys commented 2 years ago

Hey @JsMarq96!

Sorry for the delayed reply, things got quite busy while releasing Wonderland Engine 0.9.0.

What device, browser and OS are you using? If I'd make a super wild guess from the little context, it'd be that you're checking online published (HTTPS-hosted) versions for the pure JS samples and using an Oculus Quest via a local IP (http://192.168...) to access the local website with the emscripten-webxr on it.

Without HTTPS, you don't have WebXR, only on localhost this requirement is relaxed. Therefore the reported "no WebXR API" would be correct.

But that's just a very wild guess!

Best, Jonathan

JsMarq96 commented 2 years ago

Sorry for the delayed answer also and congrats on 0.9.0! And yeah it was the HTTPS... Sorry to bother with something in retrospective that obvious, I missed that one on the docs...

Squareys commented 2 years ago

No worries, it's a very common issue that everyone hits once in their WebXR career :)