Skip to content

ReferenceFeatures

Playback rate

Playback speed state and actions for the player store

Controls speed of playback. playbackRateAvailability is unsupported when the media has no playback rate, such as an embed whose provider takes no speed command.

Import

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

The audioFeatures and videoFeatures feature bundles include this feature.

API Reference

State

PropertyTypeDetails
playbackRatesreadonly number[]
playbackRatenumber
playbackRateAvailability'available' | 'unavailable' | 'unsupported'

Actions

ActionTypeDetails
setPlaybackRatefunction

Selector

Pass selectPlaybackRate to PlayerController to subscribe to playback rate state. Returns undefined if the playback rate feature is not configured.

Check playbackRateAvailability before showing a playback rate control.

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

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

class RateDisplay extends UIElement {
  readonly #rate = new PlayerController(this, selectPlaybackRate);
}