Skip to main content

Web Components — Player

<daw-player> is a lightweight single-track player from @dawcore/components: it wraps an HTMLMediaElement, so audio streams instead of decoding into memory — no Tone.js, no engine, no AudioContext to manage. Click the waveform to seek.

Loading...

What's in it

  • src streams through an HTMLMediaElement — instant start, no full decode
  • peaks-src renders a waveform from pre-computed BBC audiowaveform peaks (.dat/.json); without it the player falls back to a scrubber bar
  • timescale adds the time ruler; wave-height, bar-width/bar-gap, mono and the --daw-* CSS custom properties handle presentation
  • Methods: play(), pause(), stop(), seekTo(s), setPlaybackRate(r), setVolume(v)
  • Events: daw-ready, daw-play, daw-pause, daw-stop, daw-timeupdate ({ time }), daw-ended, daw-error — the readout above is driven by them

Run it locally

The same example as a standalone Vite app: pnpm example:dawcore-native → opens examples/dawcore-native/player.html.

In Partnership With

Télécom Paris