Playback rate
Playback speed state and actions for the player store
Controls speed of playback.
State
| State | Type | Description |
|---|---|---|
playbackRate | number | Current playback speed (1 = normal) |
playbackRates | readonly number[] | Available playback rates |
Actions
| Action | Description |
|---|---|
setPlaybackRate(rate) | Set the playback speed |
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);
}API Reference
Parameters
| Parameter | Type | Default | Details |
|---|---|---|---|
state* | object | — |
Return Value
MediaPlaybackRateState | undefined