google-ar / WebARonTango

A proposal to provide Augmented Reality (AR) capabilities to the web in the form of a prototype on top of WebVR built in Chromium.
Apache License 2.0
388 stars 48 forks source link

is there a way to detect this capabilities ? #1

Closed jeromeetienne closed 7 years ago

jeromeetienne commented 7 years ago

Hi,

First and foremost, thanks for all the good work! it is amazing :)

im writing a webar playground application which support chromium-webar. so i need to way to identify if the app is running on chromium-webar or on a normal chrome. Is there a way for me to detect this feature from javascript ?

Thanks

jeromeetienne commented 7 years ago

Currently im using something quite ugly and depending on the current build. im guessing it should be a better way :)

var isChromiumWebar = navigator.userAgent.match('Chrome/57.0.2987.5') !== null
judax commented 7 years ago

Yes, there is. As stated in the documentation, there are 2 levels to identify the capabilities:

1.- When you request the VRDisplays, check that the name is the right one. In this case, the name of the device that provides all these capabilities is "Tango VR Device". 2.- Another option is to check what capabilities the device/VRDisplay instance has. http://judax.github.io/webar/doc/webarapi/VRDisplayCapabilities.html. You can check if the device has a see through camera and/or a point cloud.

Hope this helps.

jeromeetienne commented 7 years ago

thanks!