Function

useHTMLMediaAdapter

Create and dispose a native media adapter without requiring stable source-array identity.

Usage notes

The hook preserves the adapter while ordinary URL source descriptors remain semantically equal, then reconciles changed definitions through `setSources`. The returned callback ref owns element mount, replacement, and removal transitions without requiring consumers to coordinate object refs. `ready` reports that the element is connected; use `adapter.sourceStateById` to distinguish idle, loading, recovering, ready, and failed native inputs.

Signature

Type Definition
useHTMLMediaAdapter(options: UseHTMLMediaAdapterOptions): UseHTMLMediaAdapterResult

Parameters

NameTypeDescription
optionsUseHTMLMediaAdapterOptionsComplete resolved source registry.

Returns

Adapter readiness and the current imperative adapter.