Skip to main content

Examples

Unknown Duration

Idle

On Media Card

Generated Audio Row

Props

AudioPlayer

A compact playback control for a single audio clip: a play/pause toggle, a static amplitude waveform that doubles as a seek scrubber, and elapsed/total timestamps. Designed to sit as an overlay on media thumbnails (Vault cards) as well as inline rows (the AI Voice Message “Generated Audio” row). The waveform is seeded from the decoded audio when possible, falling back to a deterministic (not random) placeholder derived from src so the result is stable across renders, SSR, and Chromatic snapshots.
string
required
URL of the audio file to play.
boolean
default:"false"
Initial playback state (uncontrolled).
number
Total duration in seconds, used to render the timestamp before the media’s own metadata has loaded (and as a fallback if it never does).
(() => void)
Called when playback reaches the end of the media.
(() => void)
Called when playback is paused.
(() => void)
Called when playback starts.
boolean
Whether playback is active (controlled). Note: once onEnded fires, the browser has already stopped native playback. To loop or replay under controlled usage, toggle this prop false then true (rather than leaving it true) — the sync effect only calls play() again when this value actually changes.
"40"
default:"40"
Height of the player row, in pixels.

Exported types

Also exported from @fanvue/ui: AudioPlayerProps, AudioPlayerSize.
Setup: Installation · Theming