Skip to main content

Type Alias: LayerCapability

LayerCapability = "media" | "webgl" | "unsupported"

Defined in: src/layers/LayerCapability.ts:14

Detects what the running platform can do with WebXR composition layers.

Layers are optional in two independent places: the session may not have been granted the layers feature, and the binding may not offer the layer type wanted. A session existing says nothing about either, so both get probed.

XRMediaBinding is called out separately because it is the cheap path for video, the compositor drives the video element and the app never draws a frame for it, but it is far less widely implemented than the WebGL path. Chrome ships quad layers via XRWebGLBinding and does not ship XRMediaBinding at all, so a video layer has to work both ways.