MAF.media.Playlist

Provides media playlist for the media player.

new MAF.media.Playlist()

Configs

autoStart : {Boolean}

Start the media when it can play. Default is true.

forcePlay : {Boolean}

Even when the bandwidth is not high enough for playback this will force playback on the lowest available bitrate stream for each entry.

repeatAll : {Boolean}

When the last media entry has finished playback, when set to true this will start playback of the first entry again. Default is false.

Methods

addEntries(entries) → {MAF.media.Playlist}

Add multiple playlist entries to the playlist.

Parameters:

NameTypeDescription
entriesArray

Multiple playlist entries in a array.

Returns:

This component.

Example

var playlist = new MAF.media.Playlist();
var entries = [];
entries.push(new MAF.media.PlaylistEntry({ url: "http://my.media.nl/video1.mp4", asset: { title: 'Video 1' } }));
entries.push(new MAF.media.PlaylistEntry({ url: "http://my.media.nl/video2.mp4", asset: { title: 'Video 2' } }));
playlist.addEntries(entries);

addEntry(entry) → {MAF.media.Playlist}

Add a media playlist entry to the playlist.

Parameters:

NameTypeDescription
entryMAF.media.PlaylistEntry

Media playlist entry to add.

Returns:

This component.

Example

var playlist = new MAF.media.Playlist();
playlist.addEntry(new MAF.media.PlaylistEntry({
   url: "http://my.media.nl/video1.mp4",
   bitrate: 2192
}));

addEntryByURL(url, bitrate)

Add a media playlist entry to the playlist defined by a url.

Parameters:

NameTypeDescription
urlString

Path to the media.

bitrateString

Bitrate the media has.

Example

var playlist = new MAF.media.Playlist();
playlist.addEntryByURL("http://my.media.nl/video1.mp4", 2192);

clearEntries()

Clear all media playlist entries from the playlist.

removeEntry(index)

Remove the media entry from the playlist at the specified index.

Parameters:

NameTypeDescription
indexNumber

Media entry index.