immersive-web / webxr-samples

Samples to demonstrate use of the WebXR Device API
https://immersive-web.github.io/webxr-samples/
MIT License
1.01k stars 489 forks source link

WebXR API not working in Chrome 67 (With all XR flags enabled) #15

Open deanmiller opened 6 years ago

deanmiller commented 6 years ago

I terribly sorry if this is not the correct place for this question, but I don't know where else to turn. I would like to play with the shiny new toy called WebXR but is doesn't seem to be working in Chome 67.

When I run the following command

navigator.xr.requestDevice()

in the console of chrome (Version 67.0.3396.62 (Official Build) (64-bit)) developer tools (after enabling ALL WebXR flags under chrome://flags and restarting the browser) I receive this error.

Uncaught (in promise) DOMException: No devices found.

This sample code also didn't work... https://github.com/immersive-web/webxr-samples/blob/master/xr-barebones.html

I tried this on a desktop and mobile Chrome browser.

Why is the WebXR API not working in Chrome 67?

Thank you

I also posted this question here (https://stackoverflow.com/questions/50623074/webxr-not-working-in-chrome-67-with-all-xr-flags-enabled) on Stackoverflow.

jsantell commented 6 years ago

Setting the flags makes the APIs available, but not necessarily the underlying XRDevice -- for example, on desktop with no external HMD hooked up (Vive, Oculus, etc.) won't have an XRDevice.

For mobile, any Daydream-ready device should work, and otherwise, you may need to install Google VR Services on the play store so that a VR device can be made available (@toji is this the case for WebXR?)

deanmiller commented 6 years ago

I believe Magic Window mode should work without a headset device being connected so the API should work on all device's. I am assuming that WebXR should work on any device in the same way A-frame does (works on any computer). I am also assuming that WebXR should work without any dependencies or polyfills.

My phone is a galaxy note 8 which I believe is listed as Daydream-ready.

vziatkov commented 6 years ago

I have the same problem. I have samsung galaxy S8+(SM G955F), open chrome canary(69.0.3451.0 Official build), enable all needed flags. But examples don't work (VR not found on blue button). Especially interesting "magic window". Also i saw Origin Trial Token, feature = WebXR Device API, origin = https://immersive-web.github.io, expires = 2018-06-19 What will happens with api after 2018-06-19? Thank you

deanmiller commented 6 years ago

WebXR Samples (https://immersive-web.github.io/webxr-samples/) Currently work with ployfill but not without... In my testing.

vziatkov commented 6 years ago

AR api works. But last canary only. I was able to make https://youtu.be/S-0fl-Eykbk. Thanks @jsantell

Squareys commented 6 years ago

Similar issue for me:

~~This works on Android, but not on Windows 10 (with an Oculus Rift connected, neither through SteamVR nor Oculus directly). For Android I would need to request a WebXR Origin Trial token for the IP of the server in the LAN, since that is not localhost. Would be very convenient if this would work with Desktop HMDs.~~

Has anybody tried with HTC Vive maybe? (Would astound me if that worked, since that's SteamVR also...)

Edit: I guess only Android O devices are supported, and instead we should be using https://github.com/immersive-web/webxr-polyfill for now.


Edit: I wrote down a couple things I learnt while releasing a WebXR game over the last three weeks. Might be useful to you: https://blog.squareys.de/how-to-webxr-july-2018/