Navigator.activeVRDisplays

Obsolete

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The activeVRDisplays read-only property of the Navigator interface returns an array containing every VRDisplay object that is currently presenting (VRDisplay.ispresenting is true).

Syntax

var myActiveDisplays = navigator.activeVRDisplays;

Value

An array of VRDisplay objects.

Examples

function showActive() {
  var displays = navigator.activeVRDisplays;
  for(var i = 0; i < displays.length; i++) {
    console.log('Display ' + displays[i].displayId + ' is active.');
  }
}

Specifications

Specification Status Comment
WebVR 1.1
The definition of 'activeVRDisplays' in that specification.
Draft Initial definition

Browser compatibility

BCD tables only load in the browser

See also