AudioPlayer
Track list player
Playing a few tracks in the page — a soundtrack sampler, a voice sample, a podcast episode. It wraps the native <audio>, so the browser handles formats and the lock-screen controls.
Basic
- The play button keeps one name (
playLabel) and says whether it's playing by its pressed state. The bar is a native range (seekLabel): arrows seek, and it reads "1:23 of 3:45". - With several tracks, the list picks one and playback moves on to the next when one ends.
Usage
ts
import { BlessAudioPlayer } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
tracks* | BlessTrack[] | — | |
color | "text" | "accent" | "danger" | "accent" | |
playLabel | string | "Play" | the play button's name; its pressed state says whether it's playing |
seekLabel | string | "Seek" | name of the seek slider |
modelValue | number | 0 | index of the current track |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: number] | |
play | [track: BlessTrack] | |
pause | [track: BlessTrack] | |
ended | [track: BlessTrack] |