coderef

Raw camera access for WebXRLimited availability

The XRView.camera property provides direct access to pose-synchronized camera images within a WebXR session.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–106Not supported
107+Supportedsince Oct 25, 2022
Current: 155
Edge
12–106Not supported
107+Supportedsince Oct 27, 2022
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–106Not supported
107+Supportedsince Oct 25, 2022
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN — see the links below.

Feature detection

JS · check before using
if ("XRCamera" in globalThis) {
  // XRCamera is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (5). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
XRCamera107107✕✕107✕✕
XRCamera.height107107✕✕107✕✕
XRCamera.width107107✕✕107✕✕
XRView.camera107107✕✕107✕✕
XRWebGLBinding.getCameraImage107107✕✕107✕✕