Skip to main content

Installation

Usage

Import the modules (each calls customElements.define), then use the elements. Nest the bar inside a <bw-player-provider>.
<bw-progress-bar> finds its nearest <bw-player-provider> ancestor. The bar fills to currentTime / duration. Pressing and dragging emits a sequence of events built with newEvent. Each one carries the pressed ratio (0–1):
  • PressedProgressBar: on press, to seek to a position.
  • ScrubbedProgressBar: while dragging.
  • FinishedScrubbingProgressBar: on release.
Drag tracking is attached to window (mouse and touch), so scrubbing keeps working even when the pointer leaves the bar. The element grows to fill its container (flex-grow: 1). Place it in a flex row alongside the other controls.
These components expect the BeyondWords player to be available as a global BeyondWords (the player UMD script). Load it before the provider connects.

Reference