# 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](../../guides/presets.md) 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`](./player-controller.md) 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);
}
```