Playback rate
Playback speed state and actions for the player store
Controls speed of playback.
API Reference
State
| Property | Type | Details |
|---|---|---|
playbackRates | readonly number[] | |
| ||
playbackRate | number | |
| ||
Actions
| Action | Type | Details |
|---|---|---|
setPlaybackRate | (rate: number) => void | |
| ||
Selector
Pass selectPlaybackRate to PlayerController to subscribe to playback rate state. Returns undefined if the playback rate feature is not configured.
import { createPlayer, MediaElement, selectPlaybackRate } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';
const { PlayerController, context } = createPlayer({ features: videoFeatures });
class RateDisplay extends MediaElement {
readonly #rate = new PlayerController(this, context, selectPlaybackRate);
}