Error
Media error state and actions for the player store
Tracks media errors.
State
| State | Type | Description |
|---|---|---|
error | MediaError | null | The current error, or null |
Actions
| Action | Description |
|---|---|
dismissError() | Clear the current error |
Selector
Pass selectError to PlayerController to subscribe to error state. Returns undefined if the error feature is not configured.
import { createPlayer, MediaElement, selectError } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';
const { PlayerController, context } = createPlayer({ features: videoFeatures });
class ErrorDisplay extends MediaElement {
readonly #error = new PlayerController(this, context, selectError);
}API Reference
Parameters
| Parameter | Type | Default | Details |
|---|---|---|---|
state* | object | — |
Return Value
MediaErrorState | undefined