# Playback rate

Playback speed state and actions for the player store

Controls speed of playback.

## Import

```tsx
import { playbackRateFeature } from '@videojs/react';
```

The `audioFeatures` and `videoFeatures` [feature bundles](https://videojs.org/docs/framework/react/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 [`usePlayer`](https://videojs.org/docs/framework/react/reference/api/use-player) to subscribe to playback rate state. Returns `undefined` if the playback rate feature is not configured.

**RateDisplay.tsx**

```tsx
import { selectPlaybackRate, usePlayer } from '@videojs/react';

function RateDisplay() {
  const rate = usePlayer(selectPlaybackRate);
  if (!rate) return null;

  return <span>{rate.playbackRate}x</span>;
}
```

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
