Interface
interface BasePlaylistItem {
id: string | number;
title?: string;
image?: string;
}
id is the stable identity used by the queue, backlog, cursor, and queueIndexOf. It must be unique within a session but does not need to be globally unique.
title and image are the canonical cross-library fields for display name and cover art.
Consumer code targeting both the video and music players should populate these fields; domain-specific code may use the library’s own field names in addition.
Library extensions
Each library extends BasePlaylistItem with domain-specific fields.
Video player, VideoPlaylistItem
| Field | Type | Description |
|---|---|---|
title? | string | Display title |
image? | string | Poster / thumbnail URL |
poster? | string | Alias for image |
thumbnail? | string | Small thumbnail (for hover previews) |
url? | string | Required by load(), the playable media URL |
subtitles? | SubtitleTrackRef[] | Subtitle sidecar files |
chapters? | ChapterRef[] | Resolved chapter list ({ index, start, end, title }) |
previewSpriteUrl? | string | VTT sprite sheet for seek-preview thumbnails |
fonts? | FontTrackRef[] | Font manifests for ASS/SSA subtitles |
Music player, MusicPlaylistItem
| Field | Type | Description |
|---|---|---|
name | string | Track name (required by the music player) |
cover? | string | Cover art URL (aliases image) |
artist? | string | Artist | Artist name or object |
album? | string | Album | Album name or object |
url? | string | Required by load(), the audio file URL |
Subtitle and chapter sidecars
Domain sidecars live in typed fields on the library item, not a generic tracks array.
On VideoPlaylistItem, subtitle files go in subtitles and resolved chapters in chapters:
// baseUrl: 'https://raw.githubusercontent.com/NoMercy-Entertainment/nomercy-media/master/Films'
{
id: 'sintel',
title: 'Sintel',
url: '/Sintel.(2010)/Sintel.(2010).NoMercy.m3u8',
subtitles: [
{
id: 'eng-full',
kind: 'subtitles',
language: 'eng',
label: 'English',
url: '/Sintel.(2010)/subtitles/Sintel.(2010).NoMercy.eng.full.vtt',
},
],
chapters: [
{ index: 0, start: 0, end: 270, title: 'Opening' },
],
}
SubtitleTrack.kind is 'subtitles', 'captions', or 'descriptions'.
Chapters take resolved { index, start, end, title } objects.
To load chapters from a VTT file instead, the core also accepts a loose sidecar array, tracks: [{ kind: 'chapters', file: '...vtt' }], which it fetches and parses when the item ships no inline chapters (see Chapters).
See also
- Loading,
load(item)usesitem.url - Media Tracks,
subtitles(),chapters() - Queue Methods, queue mutation methods accept
BasePlaylistItem