ReferenceMenus
media-playback-rate-radio-group
A menu radio group for selecting playback speed
Creates radio items from the player playback rate state and selects the playback speed.
Import
Anatomy
Behavior
The group is available when the configured media exposes playback rates. It offers the player’s playback rates, or its own when you set rates. Option labels default to the rate followed by a multiplication sign (e.g. 1.5×); pass formatRate to customize them.
When the current rate isn’t one the group offers, such as 1.1 set through the media API, the group adds it as an extra item before the next faster rate. That item carries data-custom, and its accessible name is “Custom, 1.1×” while its visible label stays 1.1×. It goes away once the rate is back on the list.
<media-playback-rate-radio-group> generates <media-menu-radio-item> children. Add an optional <template> with a single <media-menu-radio-item> to customize each generated item.
Styling
Unavailable groups receive the native hidden attribute. Each item carries data-rate, and an item for a current rate the group doesn’t offer also carries data-custom.
Accessibility
The group uses the menu radio group pattern.
The element receives an accessible label from the label property or defaults to Playback rate. Override it with aria-label or aria-labelledby.
Examples
Basic usage
API Reference
media-playback-rate-radio-group
Menu radio group that generates a <media-menu-radio-item> per available playback rate and shares the selected label
and availability with an enclosing menu. An optional <template> holding one <media-menu-radio-item> customizes
each generated item.