Skip to content

r3f-xr-widgets / VideoXR

Function: VideoXR()

VideoXR(allProps): Element

Defined in: src/components/VideoXR.tsx:48

Video player that wraps XRLayer in UIKit's Content component.

Waits for video metadata to load, then creates an XRLayer sized to the video's actual dimensions (pixelWidth, pixelHeight). This ensures correct aspect ratio and integrates with UIKit's layout system.

Use this instead of raw XRLayer when you need UIKit layout integration. For 360° videos, see EquirectPlayer which uses raw XRLayer.

Parameters

allProps

VideoXRProperties

Returns

Element

Example

tsx
<VideoXR src="/video.mp4" shape="quad" flexGrow={1} />

See

Released under the MIT License.