Skip to content
FrameworkStyle

Audio track

Audio track state and actions for the player store

Tracks available audio tracks and selects the enabled track.

API Reference

State

Property Type Details
audioTrackList MediaAudioTrack[]

Actions

Action Type Details
selectAudioTrack (value: string) => void

Selector

Pass selectAudioTrack to PlayerController to subscribe to audio track state. Returns undefined if the audio track feature is not configured.

import { createPlayer, MediaElement, selectAudioTrack } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

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

class AudioTrackInfo extends MediaElement {
  readonly #audioTrack = new PlayerController(this, context, selectAudioTrack);
}