It̵;s been two years since I was heavily involved with at Mozilla but, despite not contributing every day, I can see VR making leaps and bounds, from Firefox making an increased effort to Chrome pushing VR and Oculus and HTC (Vive) improving their offerings.  Native games are getting better but, more importantly, browsers are getting faster and three.js and aframe are empowering incredible VR experiences with .


Before you can serve up VR experiences, however, you need to ensure the browser supports VR experiences.  To do so, you need to ensure navigator.getVRDisplays is available:


const supportsVR = 'getVRDisplays' in navigator;

if (supportsVR) {
    navigator.getVRDisplays().then(function(displays) {
      // ... Load VR experience
    });
}
else {
    // ... Show "you need {x} browser" message
}


If navigator.getVRDisplays is present, it’s likely that the browser supports VR and AR experiences.


Virtual reality and augmented reality have the potential to change the  and enrich lives.  Learning how to code VR experiences will get you ahead of the curve, and as always, coding those experiences for the browser will break down the barrier of entry!


  • How I Stopped WordPress Comment Spam

    I love almost every part of being a blogger:  learning, preaching, bantering, researching.  The one part about blogging that I absolutely loathe:  dealing with SPAM comments.  For the past two years, my blog has registered 8,000+ SPAM comments per day.  PER DAY.  Bloating my database…

  • Page Visibility API

    One event that’s always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?

  • Elegant Overflow with CSS Ellipsis

    Overflow with text is always a big issue, especially in a programmatic environment. There’s always only so much space but variable content to add into that space. I was recently working on a table for displaying user information and noticed that longer strings were…

  • CSS @supports

    Feature detection via JavaScript is a client side best practice and for all the right , but unfortunately that same functionality hasn’t been available within CSS.  What we end up doing is repeating the same properties multiple times with each browser prefix.  Yuck.  Another thing we…



Source link
thanks you RSS link
( https://davidwalsh.name/detect-webvr)

LEAVE A REPLY

Please enter your comment!
Please enter your name here