- Preview
- Code
Installation
Usage
Import the modules (each callscustomElements.define), then use the elements. Nest the button inside a <bw-player-provider>.
<bw-playback-rate-button> finds its nearest
<bw-player-provider> ancestor and reads
playbackRate from it, updating on every player event. On click, it sets
player.playbackRate directly on the instance, toggling between 1 and
1.5. The current rate renders as the label (e.g. 1x). Adjust the toggle
logic to expose whatever speeds you want.