- Preview
- Code
Installation
Usage
Import the modules (each callscustomElements.define), then use the elements. Nest the playlist inside a <bw-player-provider>.
<bw-playlist> finds its nearest
<bw-player-provider> ancestor and maps over
its content. It renders a button per item and marks the active one
(contentIndex) with a now-playing icon. Pressing an item emits a PressedPlaylistItem
event (built with newEvent) carrying its index.
The event is emitted rather than setting
player.contentIndex directly. This
lets the player handle ads and outros correctly when switching tracks.