<media-playback-rate-button>
The <media-playback-rate-button> component is used to change the playback speed of your media.
The contents and behavior of the <media-playback-rate-button> will update automatically
whenever the playback rate of the media changes.
Default usage
Section titled Default usageCustomize rates
Section titled Customize ratesThe playback rates that will be cycled through when clicking can be configured using the rates attribute. These will automatically start at whatever the current playback rate is and then cycle from slower to faster rates and then loop back to the slowest rate.
Styling with attributes
Section titled Styling with attributesThe <media-playback-rate-button> is updated with Media UI Attributes any time the playback rate changes.
You can use this to style the button. In this example, we change the primary (text) color based on how fast or slow the current mediaplaybackrate rate is.
Reference
Section titled ReferenceAttributes
Section titled Attributes| Name | Type | Description | 
|---|---|---|
| rates | string | Set custom playback rates for the user to choose from. | 
| disabled | boolean | The Boolean disabled attribute makes the element not mutable or focusable. | 
| mediacontroller | string | The element `id` of the media controller to connect to (if not nested within). | 
Media UI Attributes
Section titled Media UI Attributes
      The media UI attributes will be set automatically by the controller if they are
      connected via nesting or the mediacontroller attribute.
      Only set these attributes manually if you know what you're doing.
    
| Name | Type | Description | 
|---|---|---|
| mediaplaybackrate | string | Set to the media playback rate. | 
CSS Variables
Section titled CSS Variables| Name | Default | Description | 
|---|---|---|
| --media-playback-rate-button-display | inline-flex | displayproperty of button. | 
| --media-primary-color | rgb(238 238 238) | Default color of text and icon. | 
| --media-secondary-color | rgb(20 20 30 / .7) | Default color of button background. | 
| --media-text-color | var(--media-primary-color, rgb(238 238 238)) | colorof button text. | 
| --media-icon-color | var(--media-primary-color, rgb(238 238 238)) | fillcolor of button icon. | 
| --media-control-display | displayproperty of control. | |
| --media-control-background | var(--media-secondary-color, rgb(20 20 30 / .7)) | backgroundof control. | 
| --media-control-hover-background | rgba(50 50 70 / .7) | backgroundof control hover state. | 
| --media-control-padding | 10px | paddingof control. | 
| --media-control-height | 24px | line-heightof control. | 
| --media-font | var(--media-font-weight, bold) var(--media-font-size, 14px) / var(--media-text-content-height, var(--media-control-height, 24px)) var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif) | fontshorthand property. | 
| --media-font-weight | bold | font-weightproperty. | 
| --media-font-family | helvetica neue, segoe ui, roboto, arial, sans-serif | font-familyproperty. | 
| --media-font-size | 14px | font-sizeproperty. | 
| --media-text-content-height | var(--media-control-height, 24px) | line-heightof button text. | 
| --media-button-icon-width | widthof button icon. | |
| --media-button-icon-height | var(--media-control-height, 24px) | heightof button icon. | 
| --media-button-icon-transform | transformof button icon. | |
| --media-button-icon-transition | transitionof button icon. |