In A-Frame, I want to detect if the user has a VR headset connected and to tell which device they are using. How can I do this?
Both headsets are a few hundred dollars less expensive than they were when they launched. The Rift is $399, down from $599, while the Vive is $499, down from $799. Since both now feature motion controls and whole-room VR in the box, the Oculus Rift is the better value.
The HTC Vive Pro has a much faster refresh rate than the Oculus to go along with a display of 2880×1600. The Vive doesn't just make games look better. The high-resolution-certified headphones have integrated 3D spatial sound.
Opera is one of the first browsers to support the support 360-degree videos in virtual reality headsets including HTC Vive and Oculus Rift. Moreover, Opera has direct VR playback built into the browser. So, you will be able to watch virtual reality videos instantly through your VR headset.
There are several utility functions in A-Frame we can use to detect compatibility: https://aframe.io/docs/master/core/utils.html
The mobile-related utils look at navigator.userAgent
. The VR-related utils check to see if the pose data returned from the headset/polyfill is not 0,0,0.
Given the current API:
!AFRAME.utils.checkHeadsetConnected()
AFRAME.utils.isMobile()
AFRAME.utils.isGearVR()
!AFRAME.utils.isMobile() && AFRAME.utils.checkHeadsetConnected()
!AFRAME.utils.isMobile() && AFRAME.utils.checkHeadsetConnected()
To differentiate Rift vs. Vive, try using WebVR API Stage Parameters https://w3c.github.io/webvr/#interface-vrstageparameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With