MAF.VAST

A VAST Parser Class that will download and parse a VAST XML document.

new MAF.VAST()

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' }
   ]
});

Classes

Tracker

Configs

timeout : {Number}

Number of miliseconds to wait for a VAST response to load from the ad server.

withCredentials : {Boolean}

A boolean to enable the withCredentials options for the VAST xml request.

wrapperLimit : {Number}

A number of available Wrapper responses that can be received with no InLine response.

Methods

get(url, callback)

Get a URL and parse the response XML into a valid VAST object.

Parameters:

NameTypeDescription
urlString

The URL for getting the VAST XML document.

callbackfunction

Function to be called once the VAST document is parsed. If an error occured the first parameter will contain this error. Null otherwise. The VAST object is passed as the 2nd parameter.

Events

onVASTError

Fired when an error has occured while parsing the VAST XML document.