immersive-web / webxr-samples

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

VR support not detected #131

Closed rpatel11-rbp closed 2 years ago

rpatel11-rbp commented 2 years ago

I cloned webxr-samples and tried to run the project in chrome. But I got message like "VR support not detected" on the front page, so can you please provide the proper steps to build and run the project with VR support in chrome.

AdaRoseCannon commented 2 years ago

Are you using https?

rpatel11-rbp commented 2 years ago

I am trying to run a project on localhost. Is it the correct way to run the project or anything else? Correct me if i am wrong and provide me the proper steps

rpatel11-rbp commented 2 years ago

image

AdaRoseCannon commented 2 years ago

That's not local host that's just opening a html file in the browser. Run a local http server and open that from localhost in the browser. Local host is a secure origin which will let the WebXR Device API work.

rpatel11-rbp commented 2 years ago

image I have not found package.json file from this directory structure. So how can I run a local HTTP server, Is there any way to run an HTTP server and local host?

AdaRoseCannon commented 2 years ago

you don't need a package.json, just use your http-server of choice. Assuming you have npm/npx try this: https://www.npmjs.com/package/http-server

It appears you are using Chrome so if you want a browser extension method instead try this: https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en

rpatel11-rbp commented 2 years ago

Now it is working fine. Thank you!