VRDisplay.stageParameters

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The stageParameters read-only property of the VRDisplay interface returns a VRStageParameters object containing room-scale parameters, if the VRDisplay is capable of supporting room-scale experiences.

Syntax

var myStageParameters = vrDisplayInstance.stageParameters;

Value

VRStageParameters object containing the VRDisplay's room-scale parameters, or null if the VRDisplay is not capable of supporting room-scale experiences.

Examples

var info = document.querySelector('p');
var vrDisplay;

navigator.getVRDisplays().then(function(displays) {
  vrDisplay = displays[0];
  var stageParams = vrDisplay.stageParameters;
  // stageParams is a VRStageParameters object

  if(stageParams === null) {
    info.textContent = 'Your VR Hardware does not support room-scale experiences.'
  } else {
    info.innerHTML = '<strong>Display stage parameters</strong>'
                 + '<br>Sitting to standing transform: ' + stageParams.sittingToStandingTransform
                 + '<br>Play area width (m): ' + stageParams.sizeX
                 + '<br>Play area depth (m): ' + stageParams.sizeY
  }
});

Specifications

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

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No15

555

636

No ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No561 2 3 4 ? ? ? ?6.0

1. Only works in an experimental version of Chrome. (Other builds won't return any devices when Navigator.getVRDisplays() is invoked.)

2. Daydream View supported in Chrome 56.

3. Google Cardboard supported in Chrome 57.

4. From version 56: this feature is behind the WebVR preference. To change preferences in Chrome, visit chrome://flags.

5. Windows support was enabled in Firefox 55.

6. macOS support was enabled in Firefox 63.

See also

Document Tags and Contributors

Contributors to this page: fscholz, chrisdavidmills, abbycar
Last updated by: fscholz,