The XR system supports multiple backends (refer to XR Overview), currently, the official support is only for the WebXR standard, so the compatibility of XR interactions is also limited by the device's compatibility with WebXR.
Before using XR capabilities, you can refer to CanIUse to evaluate the runtime environment. Below is a summary of the current WebXR compatibility.
Depending on the situation, you can refer to the headset's official website for compatibility information. Most browsers in headsets (browsers with Chromium kernel) support WebXR.
In the runtime, you can use the following code to check if the current environment supports AR
or VR
:
// Check if AR is supported
xrManager.sessionManager.isSupportedMode(XRSessionMode.AR);
Before adding features, you can use the following code to check the compatibility of the feature:
// Check if image tracking is supported
xrManager.isSupportedFeature(XRImageTracking);
Android supports some experimental features, but they are turned off by default. You can enable them by setting flags: Open Chrome on Android -> Log in to chrome://flags -> Search for WebXR -> Enable WebXR Incubations