IUseMediaPlayerOptions

interface
Component Props

Options accepted by useMediaPlayer. The composable is media-agnostic — mediaRef accepts any HTMLMediaElement (audio OR video).

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>
false
Suppress autoplay when the user has requested reduced motion.
muted
MaybeRefOrGetter<boolean>
false
Initial muted state.
loop
boolean
false
Loop on ended.
preload
'none' | 'metadata' | 'auto'
'metadata'
Buffering hint passed to the HTMLMediaElement.
mediaRef
Ref<HTMLMediaElement | null>
Resolves to the HTMLMediaElement to drive. When omitted, the composable creates an empty ref and expects the consumer to bind it on a <video ref> / <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.

Passing options to useMediaPlayer

typescript