# Playback rate

Playback speed state and actions for the player store

Controls speed of playback.

## Import

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

The `audioFeatures` and `videoFeatures` [feature bundles](https://videojs.org/docs/framework/html/guides/presets) include this feature.

## API Reference

### State

| Property | Type | Description |
| --- | --- | --- |
| `playbackRates` | `readonly number[]` | Available playback rates. |
| `playbackRate` | `number` | Current playback rate. |

### Actions

| Action | Type | Description |
| --- | --- | --- |
| `setPlaybackRate` | `(rate: number) => void` | Set the playback rate. |

### Selector

Pass `selectPlaybackRate` to [`PlayerController`](https://videojs.org/docs/framework/html/reference/api/player-controller) to subscribe to playback rate state. Returns `undefined` if the playback rate feature is not configured.

**rate-display.ts**

```ts
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);
}
```

---

HTML documentation: https://videojs.org/docs/framework/html/llms.txt
All documentation: https://videojs.org/llms.txt
