MAF.media.PlaylistEntry

This defines a media entry for the playlist in which multiple streams with different bitrates can be added. If you provide multiple streams with bitrates the fastest will be selected thats supported by the user's connection speed.

new MAF.media.PlaylistEntry()

Configs

asset : {MAF.media.Asset}

Information about the media.(title, description, poster)

bitrate : {Number}

Bitrate of the media.

streams : {Array}

Array of objects with a url and a bitrate property. When the object contains no bitrate it will inherit from the bitrate config.

Example

The below example will add 2 streams to the media entry both having a bitrate of 1000

new MAF.media.PlaylistEntry({
   bitrate: 1000,
   streams: [
      { url: 'http://my.url/video1.mp4' },
      { url: 'http://my.url/video2.mp4' }
   ]
});

url : {String}

Media path

Methods

addURL(url, bitrate) → {MAF.media.PlaylistEntry}

Add a new stream to this media entry.

Parameters:

NameTypeArgumentDescription
urlString

Media path.

bitrateNumberoptional 

Bitrate of media.

Returns:

This component.

hasURL(url) → {Boolean}

Checks if this playlist entry has the url as defined by the parameter.

Parameters:

NameTypeDescription
urlString

Media path.

Returns:

True if the url is already in this playlist entry.