IUseOrigamAudioPlayerOptions

interface
Composable Options

Options accepted by the Audio-namespace useAudioPlayer composable. Named distinctly from the legacy IUseAudioPlayerOptions in the Sound namespace so both can coexist in the public barrel.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

autoplay
MaybeRefOrGetter<boolean>
Suppress autoplay when the user has requested reduced motion.
muted
MaybeRefOrGetter<boolean>
Initial muted state.
loop
boolean
Loop on ended.
preload
'none' | 'metadata' | 'auto'
Buffering hint.
audioRef
Ref<HTMLAudioElement | null>
Resolves to the HTMLAudioElement to drive. When omitted, the composable creates an empty ref and expects the consumer to bind it on a <audio ref> themselves.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Wiring useAudioPlayer to an <audio> element

typescript