Playlist

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:

Endpoints

MethodDescription
.next()Tells JW Player to immediately play the next playlist item.
.getPlaylist()Returns an array of objects from a playlist. Any additional custom playlist properties will also be returned. See the playlist section above for the structure of these objects.
.getPlaylistItem(index)NA
.getPlaylistIndex()NA
.load(playlist)NA
.playlistItem(index)NA
.setPlaylistItemCallback(callback)Registers a playlist item callback that can modify or block the progression of a playlist
.removePlaylistItemCallback()Removes the callback and all playlist item Promises
.getPlaylistItemPromise(index)Gets the Promise for a particular playlist item


Events

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