These API calls are used for loading and retrieving the current playlist (of one or more items), as well as for navigating between playlist items. When accessed via the API, a playlist is an Array, containing one or more objects. Each of these objects contains the following:
Value | Description | Type |
---|---|---|
description | A description specified inside of the playlist | String |
mediaid | A unique media identifier for a particular piece of content, regardless of the format used | String |
file | Provides a shortcut to sources[0].file. Alternative files are listed in the allSources array | String |
image | The poster image file loaded inside of the player | String |
preload | Preload status for current item. Can be: metadata | auto | none | String |
title | The title of the playlist item | String |
tracks | The full array of tracks included with the playlist item, similar to getCaptionsList() | Array |
sources | An array that contains a single object with information about the currently utilized source | Array |
allSources | An array of all configured sources for the current playlist item | Array |
Each playlist item has a file property at the highest level, which acts as a shortcut to the file of the first entry in the sources object.
The sources
array contains a single object with information about the currently utilized source:
Value | Description | Type |
---|---|---|
file | The file used in the source array item | String |
label | A label assigned to a particular quality | String |
type | The media type | String |
default | If this media source has been defined as a default for playback | Boolean |
The tracks
array contains a list of objects based on any configured tracks:
Value | Description | Type |
---|---|---|
file | The file used containing any utilized tracks | String |
label | If using captions, the configured label assigned to a particular quality | String |
kind | The type of tracks assigned to the video. Can be: captions | chapters | thumbnails | String |
.on('nextClick')
Fires after the next button (in the control bar) or the next up overlay is clicked.
.on('playlist')
Fired when an entirely new playlist has been loaded into the player.
This event is not fired as part of the initial playlist load. Please use
on('ready')
in these cases.
Returns an object with the following:
Value | Description | Type |
---|---|---|
playlist | The new playlist array; Provides the same output as getPlaylist() | Array |
.on('playlistItem')
Fired when the playlist index changes to a new playlist item. This event occurs before the player begins playing the new playlist item.
Returns an object with the following:
Value | Description | Type |
---|---|---|
index | Index of the currently playing playlist item | Number |
item | The current playlist item; Provides the same output as getPlaylistItem() | Object |
.on('playlistComplete')
Fires when the following occurs:
- The player has completed playing all items in the playlist
- The repeat option is set to
false
{
"type": "playlistComplete"
}
Property | Description |
---|---|
type string | Type of event
This is always playlistComplete .
|