Skip to main content

Installation

Usage

Import the modules (each calls customElements.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.
These components expect the BeyondWords player to be available as a global BeyondWords (the player UMD script). Load it before the provider connects.

Reference