files/en-us/web/api/vrdisplay/index.md
{{APIRef("WebVR API")}}{{Deprecated_Header}}{{Non-standard_Header}}
The VRDisplay interface of the WebVR API represents any VR device supported by this API. It includes generic information such as device IDs and descriptions, as well as methods for starting to present a VR scene, retrieving eye parameters and display capabilities, and other important functionality.
[!NOTE] This interface was part of the old WebVR API. It has been superseded by the WebXR Device API.
An array of all connected VR Devices can be returned by invoking the {{domxref("Navigator.getVRDisplays()")}} method.
VRDisplay.VRDisplay.VRDisplay is connected to the computer.VRDisplay is currently having content presented through it.VRDisplay is capable of supporting room-scale experiences.VRDisplay, with no prediction applied. This is no longer needed, and has been removed from the spec.VRDisplay.VRDisplay as it will be when the current frame is actually presented. This method is deprecated — instead, you should use {{domxref("VRDisplay.getFrameData()")}}, which also provides a {{domxref("VRPose")}} object.VRDisplay, treating its current {{domxref("VRPose.position")}} and {{domxref("VRPose.orientation")}} as the "origin/zero" values.VRDisplay presentation is rendered.VRDisplay presenting a scene.VRDisplay presenting a scene.VRDisplay.if (navigator.getVRDisplays) {
console.log("WebVR 1.1 supported");
// Then get the displays attached to the computer
navigator.getVRDisplays().then((displays) => {
// If a display is available, use it to present the scene
if (displays.length > 0) {
vrDisplay = displays[0];
// Now we have our VRDisplay object and can do what we want with it
}
});
}
[!NOTE] You can see this complete code at raw-webgl-example.
This interface was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.
Until all browsers have implemented the new WebXR APIs, it is recommended to rely on frameworks, like A-Frame, Babylon.js, or Three.js, or a polyfill, to develop WebXR applications that will work across all browsers. Read Meta's Porting from WebVR to WebXR guide for more information.
{{Compat}}