Playlist Events

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:

ValueDescriptionType
descriptionA description specified inside of the playlistString
mediaidA unique media identifier for a particular piece of content, regardless of the format usedString
fileProvides a shortcut to sources[0].file. Alternative files are listed in the allSources arrayString
imageThe poster image file loaded inside of the playerString
preloadPreload status for current item. Can be: metadata | auto | noneString
titleThe title of the playlist itemString
tracksThe full array of tracks included with the playlist item, similar to getCaptionsList()Array
sourcesAn array that contains a single object with information about the currently utilized sourceArray
allSourcesAn array of all configured sources for the current playlist itemArray

πŸ“˜

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:

ValueDescriptionType
fileThe file used in the source array itemString
labelA label assigned to a particular qualityString
typeThe media typeString
defaultIf this media source has been defined as a default for playbackBoolean

The tracks array contains a list of objects based on any configured tracks:

ValueDescriptionType
fileThe file used containing any utilized tracksString
labelIf using captions, the configured label assigned to a particular qualityString
kindThe type of tracks assigned to the video. Can be: captions | chapters | thumbnailsString

.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:

ValueDescriptionType
playlistThe 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:

ValueDescriptionType
indexIndex of the currently playing playlist itemNumber
itemThe current playlist item; Provides the same output as getPlaylistItem()Object

.on('playlistComplete')

Fired when the player is done playing all items in the playlist. If the repeat option is set true, this will not be triggered.

ValueDescriptionType
-No value returned-