Advertisements

1. Advertisement object:

Variable nameTypeDescription
vmapstringString containing :
- url pointing to valid VMAP xml file,
- valid VMAP xml data,
- valid URL encoded VMAP xml data.
(For more details about VMAP see)
breaksarrayArray of break objects (for more details see Advertisement break object).
vastLoopUrlstringThis option is for continuous ads presentation without any other content (only ads).
String containing link to VAST xml file with ads.
Ads from this file are displayed in loop.

2. Advertisement break object:

Variable nameTypeDescription
timeOffsetstring[required] Advertisement playback time (in HH:MM:SS or HH:MM:SS.mmm format).
(For more details see VMAP documentation)
vaststringString containing :
- url pointing to valid VMAP xml file,
- valid VAST xml data,
- valid URL encoded VAST xml data.
(For more details about VAST see)
adobjectArray of ad objects. (for more details see Advertisement Break Ad Object)

3. Advertisement break ad object:

Variable nameTypeDescription
durationstring[required] Description of advertisement playback duration (in HH:MM:SS or HH:MM:SS.mmm format) (For more details see VAST documentation)
mediaarray[required] Array of media objects. (for more details see Advertisement Break Ad Media Object)

4. Advertisement break ad media object:

Variable nameTypeDescription
urlstring[required] Url pointing to advertisement media file.
apiFrameworkstringIdentifies the API needed to execute an interactive media file.
deliverystringEither “progressive” for progressive download protocols (such as HTTP) or “streaming” for streaming protocols.
bitratestringFor progressive load video, the bitrate value specifies the average bitrate for the media file.
widthstringNative width of the video file, in pixels.
heightstringNative height of the video file, in pixels.
typestringMIME type for the file container. Popular MIME types include, but are not limited to “video/xflv” for Flash Video and “video/mp4” for MP4.

Advertisement configuration example with url to xml vmap file:

var playerConfig = {
    advertisement: { 
        vmap: 'http://bradmax.com/static/a/vmap.xml'
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • or URL encoded xml vmap data:

var playerConfig = {
    advertisement: { 
        vmap: `%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Cvmap%3AVMAP%20xmlns%3Avmap%3D%22http%3A%2F%2Fwww.iab.net%2Fvmap-1.0%22%20version%3D%221.0%22%3E%3Cvmap%3AAdBreak%20breakId%3D%221%22%20breakType%3D%22linear%22%20timeOffset%3D%22start%22%3E%3Cvmap%3AAdSource%20allowMultipleAds%3D%22true%22%20followRedirects%3D%22true%22%20id%3D%221%22%3E%0A%3Cvmap%3AVASTAdData%3E%3CVAST%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%20version%3D%223.0%22%20xsi%3AnoNamespaceSchemaLocation%3D%22vast.xsd%22%3E%3CAd%20id%3D%22bradmax_1%22%20sequence%3D%221%22%3E%3CInLine%3E%3CCreatives%3E%3CCreative%20id%3D%221%22%3E%3CLinear%3E%3CDuration%3E00%3A00%3A05%3C%2FDuration%3E%3CMediaFiles%3E%3CMediaFile%20delivery%3D%22streaming%22%20bitrate%3D%222237%22%20width%3D%221280%22%20height%3D%22720%22%20type%3D%22video%2Fmp4%22%3E%3C!%5BCDATA%5Bhttp%3A%2F%2Fbradmax.com%2Fstatic%2Fvideo%2Fpreroll_1of2.mp4%5D%5D%3E%3C%2FMediaFile%3E%0A%3C%2FMediaFiles%3E%3C%2FLinear%3E%3C%2FCreative%3E%3C%2FCreatives%3E%3CExtensions%3E%3C%2FExtensions%3E%3C%2FInLine%3E%3C%2FAd%3E%3C%2FVAST%3E%3C%2Fvmap%3AVASTAdData%3E%3C%2Fvmap%3AAdSource%3E%3C%2Fvmap%3AAdBreak%3E%3C%2Fvmap%3AVMAP%3E%0A`
        },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • or inline xml vmap data:

var playerConfig = {
    advertisement: { 
        vmap: `<?xml version="1.0" encoding="UTF-8"?><vmap:VMAP xmlns:vmap="http://www.iab.net/vmap-1.0" version="1.0"><vmap:AdBreak breakId="1" breakType="linear" timeOffset="start"><vmap:AdSource allowMultipleAds="true" followRedirects="true" id="1">
<vmap:VASTAdData><VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:noNamespaceSchemaLocation="vast.xsd"><Ad id="bradmax_1" sequence="1"><InLine><Creatives><Creative id="1"><Linear><Duration>00:00:05</Duration><MediaFiles><MediaFile delivery="streaming" bitrate="2237" width="1280" height="720" type="video/mp4"><![CDATA[http://bradmax.com/static/video/preroll_1of2.mp4]]></MediaFile>
</MediaFiles></Linear></Creative></Creatives><Extensions></Extensions></InLine></Ad></VAST></vmap:VASTAdData></vmap:AdSource></vmap:AdBreak></vmap:VMAP>`
        },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};

Advertisement configuration example with ad breaks:

  • configuration with mp4 media

var playerConfig = {
    advertisement: { 
        breaks: [
            {
                timeOffset: '00:00:00',
                ad: {
                    duration: "00:00:05",
                    media: [
                        {
                            delivery: "streaming",
                            bitrate: "256",
                            width: "650",
                            height: "650",
                            type: "video/mp4",
                            url: "http://bradmax.com/static/video/preroll_1of2.mp4"
                        }
                    ]
                }
            }
        ]
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • configuration with vpaid media

var playerConfig = {
    advertisement: { 
        breaks: [
            {
                timeOffset: '00:00:05',
                ad: {
                    duration: "00:00:15",
                    media: [
                        {
                            apiFramework: "VPAID",
                            delivery: "progressive",
                            bitrate: "256",
                            width: "16",
                            height: "9",
                            type: "application/javascript",
                            url: "http://static.innovid.com/mobileapps/js/vpaid/1h41kg?cb=0ef1c87f-3745-1b3f-7978-b942737337c7&deviceid=&ivc=[ecp]"
                        }
                    ]
                }
            }
        ]
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • configuration with inline vast

var playerConfig = {
    advertisement: { 
        breaks: [
            {
                timeOffset: '00:00:00',
                vast: `<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:noNamespaceSchemaLocation="vast.xsd"><Ad id="bradmax_1" sequence="1"><InLine><Creatives><Creative id="1"><Linear><Duration>00:00:05</Duration><MediaFiles><MediaFile delivery="streaming" bitrate="2237" width="1280" height="720" type="video/mp4"><![CDATA[http://bradmax.com/static/video/preroll_1of2.mp4]]></MediaFile>
</MediaFiles></Linear></Creative></Creatives><Extensions></Extensions></InLine></Ad></VAST>`
            }
        ]
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • configuration with inline vast url encoded data

var playerConfig = {
    advertisement: { 
        breaks: [
            {
                timeOffset: '00:00:00',
                vast: '%3CVAST%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%20version%3D%223.0%22%20xsi%3AnoNamespaceSchemaLocation%3D%22vast.xsd%22%3E%3CAd%20id%3D%22bradmax_1%22%20sequence%3D%221%22%3E%3CInLine%3E%3CCreatives%3E%3CCreative%20id%3D%221%22%3E%3CLinear%3E%3CDuration%3E00%3A00%3A05%3C%2FDuration%3E%3CMediaFiles%3E%3CMediaFile%20delivery%3D%22streaming%22%20bitrate%3D%222237%22%20width%3D%221280%22%20height%3D%22720%22%20type%3D%22video%2Fmp4%22%3E%3C!%5BCDATA%5Bhttp%3A%2F%2Fbradmax.com%2Fstatic%2Fvideo%2Fpreroll_1of2.mp4%5D%5D%3E%3C%2FMediaFile%3E%0A%3C%2FMediaFiles%3E%3C%2FLinear%3E%3C%2FCreative%3E%3C%2FCreatives%3E%3CExtensions%3E%3C%2FExtensions%3E%3C%2FInLine%3E%3C%2FAd%3E%3C%2FVAST%3E'
            }
        ]
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};
  • configuration example with url to xml vast file:

var playerConfig = {
    advertisement: { 
        breaks: [
            {
                timeOffset: '00:00:00',
                vast: 'http://bradmax.com/static/a/vast.xml'
            }
        ]
    },
    dataProvider: {
        source: [{ url: "http://bradmax.com/static/video/tears_of_steel.mp4" }]
    }
};

Advertisement configuration for continious ads presentation (VAST ads loop):

var playerConfig = {
    advertisement: {
        vastLoopUrl: "https://bradmax.com/static/a/vast.bradmax.xml"
    }
};