PlaybackRateButton cycles through playback rates on click. The default rate list is [1, 1.2, 1.5, 1.7, 2]. After the last rate, it wraps back to the first. If the current rate isn’t in the list (e.g., set programmatically), the button jumps to the next rate greater than the current one.
Requires the
playbackRate feature to be registered with the player.Import
Basic Usage
Custom Render with Rate Display
Custom Rates
Props
Custom list of playback rates to cycle through. Defaults to
[1, 1.2, 1.5, 1.7, 2].Custom render prop. Receives the computed HTML props and current state. Use
state.rate to display the current rate.Override the automatic
aria-label. By default: "Playback rate 1.5" (includes the current rate).Disables the button.
CSS class name or a function that receives state and returns a class name.
Inline style or a function that receives state and returns a style object.
State Data Attributes
| Attribute | Value / Description |
|---|---|
data-rate | The current playback rate as a string (e.g., "1.5"). |
Accessibility
Renders a<button> element. The aria-label is automatically set to "Playback rate {rate}" (e.g., "Playback rate 1.5"). Override with the label prop. Keyboard activation: Enter / Space.