Proper Video Player Documentation

Unity 6 WebGPU experimental

In a compatible Unity WebGPU build, video frames are transferred with GPUQueue.copyExternalImageToTexture instead of the WebGL texSubImage2D path. The backend selects the transfer path from the native texture handle at runtime.

Activation and verification#

No player API changes are required. Streaming, playback controls, events, and watchdog behavior continue to use the same browser video element. Check UploadViaWebGpu after the player is initialized to verify the active transfer path:

Debug.Log(player.UploadViaWebGpu
    ? "WebGPU video upload is active"
    : $"WebGPU video upload is not active; frame gate: {player.UploadPath}");

UploadPath still reports how new frames are detected, such as VideoFrameCallback or FrameCounter; it does not identify the transfer API.

RenderTexture sizing#

  • Auto-managed texture: leave Target Texture empty. The component recreates the texture at the decoded video dimensions and rebinds it to the WebGPU upload path.
  • User-supplied texture: the player does not resize it. If it is smaller than the decoded frame, the copy is limited to the target dimensions and the frame is cropped. Use a texture that matches the source dimensions when the complete frame is required.
  • Low-level bridge: if video dimensions change, create an appropriately sized texture and pass it to WebGLVideoBridge.SetTargetTexture. See WebGLVideoBridge.

Compatibility#

WebGPU availability depends on the Unity editor version, build configuration, browser, operating system, and graphics adapter. The package records validation with Unity 6000.5 and Chrome; this is not a complete support matrix. Verify production builds on each supported platform. If the backend cannot resolve a WebGPU texture or device, it logs a browser-console warning and does not report UploadViaWebGpu as active.