Skip to content
Client
Server

Reference / @open-music-sdk/lib-preview-player / tPreviewPlayerState

Interface: tPreviewPlayerState<T> ​

Defined in: lib/lib-preview-player/src/player.ts:98

What a page draws a player from. Each one is frozen, and replaced by another only when something in it changed.

Type Parameters ​

T ​

T extends tPreviewable = tPreviewable

Properties ​

duration ​

ts
readonly duration: number;

Defined in: lib/lib-preview-player/src/player.ts:110

How long the current clip is, in seconds, or 0 until the element knows.


index ​

ts
readonly index: number;

Defined in: lib/lib-preview-player/src/player.ts:104

Where in the queue the current track is, or -1 when none is.


position ​

ts
readonly position: number;

Defined in: lib/lib-preview-player/src/player.ts:108

How far into the current clip the element is, in seconds.


status ​

ts
readonly status: tPreviewStatus;

Defined in: lib/lib-preview-player/src/player.ts:100

Where the player stands: idle, loading, playing, paused, ended or in error.


track ​

ts
readonly track: T | undefined;

Defined in: lib/lib-preview-player/src/player.ts:106

The current track, or undefined when none is.


tracks ​

ts
readonly tracks: readonly T[];

Defined in: lib/lib-preview-player/src/player.ts:102

The queue: the tracks load kept, in the order they were handed over.


volume ​

ts
readonly volume: number;

Defined in: lib/lib-preview-player/src/player.ts:112

The element's volume, from 0 to 1.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.