Skip to content

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

NameTypeDefaultDescription
tracks*BlessTrack[]—
color"text" | "accent" | "danger""accent"
playLabelstring"Play"the play button's name; its pressed state says whether it's playing
seekLabelstring"Seek"name of the seek slider
modelValuenumber0index of the current track

Events

NamePayloadDescription
update:modelValue[value: number]
play[track: BlessTrack]
pause[track: BlessTrack]
ended[track: BlessTrack]

Released under the MIT License. Character names and artwork belong to their owners.