Class: Ad

Ad

Represents an ad or a set of podded ads. This object contains a reference to the actual ad object provided by the ad manager. Constructor: Represents an ad or a set of podded ads. This object contains a reference to the actual ad object provided by the ad manager.
Initialize an instance of the current class using the new keyword along with this constructor.
Parameters:
Name Type Description
adData object The ad data object describes the ad, it must contain the following fields:
position {number} The time in the video at which the ad(s) will play (Refer to positionType for time unit)
positionType {string} How to interpret the ad position value. Either 'p' for percents(0-100) or 't' for time in seconds. Default is 't' if not specified.
mainContentDuration {number} The time length, seconds, of the main video stream
duration {number} The duration of the ad(s) (seconds).
adManager {string} The name of the ad manager ({adManager}.name) that will play the ad.
ad {object} The ad object.
adType {string} The type of ad created (e.g. {AdManagerController}.ADTYPE.LINEAR_VIDEO).
Properties:
Name Type Description
id string A unique ID for the ad.
position number The position in the stream at which to play the ad (seconds).
duration number The duration of the ad (seconds).
adManager string The name of the ad manager that owns the ad.
ad object The ad object.
isLinear boolean true if the ad is linear, false otherwise.
played boolean true if the ad has been played during the current video, false otherwise.
videoRestrictions object An object that lists restrictions the ad manager has on the video plugin
isRequest boolean True if this ad is only for an ad request and the ad isn't known
streams object An object containing keys for the stream format and values that are the urls for those streams used. ex. {"technology":OO.VIDEO.TECHNOLOGY.HTML5, "features":[OO.VIDEO.FEATURE.VIDEO_OBJECT_OPEN]}
Example
var amc = new AdManagerController(mb, id);
var ad = new amc.Ad({position:10000, duration:7000, adManager:"example-ad-manager", ad:adObj,
                     adType:amc.ADTYPE.LINEAR_VIDEO});