Skip to content
FrameworkStyle

Error

Media error state and actions for the player store

Tracks media errors.

Import

import { errorFeature } from '@videojs/html';

The audioFeatures, liveAudioFeatures, liveVideoFeatures, and videoFeatures feature bundles include this feature.

API Reference

State

PropertyTypeDetails
error{ code: number; message: string } | null

Actions

ActionTypeDetails
dismissError() => void

Selector

Pass selectError to PlayerController to subscribe to error state. Returns undefined if the error feature is not configured.

import { createPlayer, UIElement, selectError } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

const { PlayerController } = createPlayer({ features: videoFeatures });

class ErrorDisplay extends UIElement {
  readonly #error = new PlayerController(this, selectError);
}