Tuesday, April 30, 2024
HomeTechnologySoftwareDetect XR Support with JavaScript

Detect XR Support with JavaScript

Date:

Related stories

2 Times Anger Is Acceptable in Marriage and 3 Times It’s Not

I’m guessing you don’t need a dictionary definition...

What Are Vampire Facial and PRP Treatments—Expert Tips

Vampire facials have earned a reputation for producing...

The Benefits Of Meditation In The Classroom –

contributed by Beth Rush, Managing Edition at Body...

Is NAR A Net-Positive? It Depends If You Ask An Agent Or A Broker: Intel

These increasingly uncertain attitudes among agents in March...
spot_imgspot_img

A few years ago I wrote an article about how to detect VR support with JavaScript. Since that time, a whole lot has changed. “Augmented reality” became a thing and terminology has moved to “XR”, instead of VR or AR. As such, the API has needed to evolve.

The presence of navigator.xr signals that the browser supports the WebXR API and XR devices:

const supportsXR = 'xr' in window.navigator;

I really like using in for feature checking rather than if(navigator.xr), as simply invoking that could cause some initialization to take place. In future posts we’ll explore identifying and connecting to different devices.

  • Animating CSS3 Transforms with MooTools Fx
  • fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn’t really made for what we’ve been using it for.  We’ve done well to create elegant APIs around XHR but we know we can do better.  Our effort to…



Source link

Latest stories

spot_img