ReferenceButtons
media-playback-rate-button
A button that cycles through playback speed rates
Import
Anatomy
Behavior
Cycles through the player’s playback rates on click, in the order they are listed. The default list is [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]; see the playback rate feature to set your own for the whole player, or set rates on the button to give it its own list. 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.
When commandfor is set, activation opens the linked playback-rate menu instead of cycling through rates. Use this mode when the button is the trigger for a <media-menu> that contains playback-rate options.
When the media’s playback rate is unavailable or unsupported, such as on an embed that takes no speed command, the element receives the native hidden attribute and ignores activation.
Styling
Display the current rate using the data-rate attribute:
Accessibility
Renders a <button> with an automatic aria-label of "Playback rate, {rate}" (e.g., "Playback rate, 1.5"). Its tooltip shows "Playback rate" without the value. Override both with the label prop. Keyboard activation: Enter / Space.
In menu-trigger mode, the button behaves as a menu trigger and reflects menu state through the trigger attributes.