IMediaPlayerState

interface
Component Props

Reactive state surface returned by useMediaPlayer — the media-agnostic base shared between useVideoPlayer and useAudioPlayer. All fields are Vue Refs so they are directly bindable in templates.

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.

playing
required
Ref<boolean>
True while the element is decoding frames / producing audio.
paused
required
Ref<boolean>
True when playback is paused (or has not started yet).
currentTime
required
Ref<number>
Current playhead position in seconds.
duration
required
Ref<number>
Total duration in seconds. NaN until metadata loads. Can be Infinity for live streams — consumers must guard max UI bindings with Number.isFinite().
buffered
required
Ref<number>
End of the buffered range in seconds (the right edge of the last contiguous chunk the browser can play without stalling).
volume
required
Ref<number>
Volume between 0 and 1 — independent from muted.
muted
required
Ref<boolean>
True when the output is muted. Independent from volume.
ready
required
Ref<boolean>
True once metadata has loaded and duration is finite.
loading
required
Ref<boolean>
True between loadstart and loadedmetadata (or waiting).
error
required
Ref<MediaError | Error | null>
Last media error captured by the composable, if any.
playbackRate
required
Ref<number>
Current playback rate. 1 = normal speed.
remoteAvailable
required
Ref<boolean>
True when at least one Remote Playback device is reachable.
remoteState
required
Ref<'disconnected' | 'connecting' | 'connected'>
Connection state of the Remote Playback session.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Binding reactive state from useMediaPlayer

typescript