Type Definitions
creativeData :Object
Object with the trafficking ad parameters and the xmlEncoded flag.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
AdParameters |
string |
<optional> |
the AdParameters of the linear Ad as they come in the VAST XML. |
xmlEncoded |
boolean |
<optional> |
true if the AdParameters are xml encoded and false otherwise |
InteractiveFile :Object
VAST InteractiveFile representation For more info please take a look at the VAST specification
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
apiFramework |
string |
<optional> |
will most likely be |
src |
string |
<optional> |
The source file url. |
type |
string |
<optional> |
MIME type for the file container like |
MediaFile :Object
VAST MediaFile representation. For more info please take a look at the VAST specification
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
codec |
string |
<optional> |
The codec used to encode the file which can take values as specified by RFC 4281. |
delivery |
string |
<optional> |
Either |
height |
number |
<optional> |
The native height of the video file, in pixels. |
id |
string |
<optional> |
An identifier for the media file. |
maintainAspectRatio |
string |
<optional> |
Boolean value that indicates whether aspect ratio for media file dimensions should be maintained when scaled to new dimensions |
bitrate |
string |
<optional> |
For progressive load video, the bitrate value specifies the average bitrate for the media file |
maxBitrate |
string |
<optional> |
max bitrate for streaming videos. |
minBitrate |
string |
<optional> |
min bitrate for streaming videos. |
scalable |
string |
<optional> |
Boolean value that indicates whether the media file is meant to scale to larger dimensions |
src |
string |
<optional> |
The source file url. |
type |
string |
<optional> |
MIME type for the file container. Popular MIME types include, but are not limited to “video/x-flv” for Flash Video and “video/mp4” for MP4. |
width |
number |
<optional> |
The native width of the video file, in pixels. |
universalAdId |
string |
<optional> |
A string identifying the unique creative identifier. |
ParsedAd :Object
Deserialised ad object from a parsedVast object.
ParsedOffset
The parsed time offset in milliseconds or a string with the percentage
ParsedVast :Object
JS XML deserialised object.
parseXml
Parses the passed xml text.
Parameters:
Name | Type | Description |
---|---|---|
xmlText |
string |
XML text to be parsed. |
- Source:
Throws:
if there is an error parsing the xml.
pixelTracker :TrackerFn
Creates a tracking image with the passed URL macro.
Parameters:
Name | Type | Description |
---|---|---|
URLMacro |
string |
URL Macro that need to be tracked. |
data |
Object |
Data Object with the macros's variables. |
- Source:
TrackerFn(URLMacro, data)
Tracking function.
Parameters:
Name | Type | Description |
---|---|---|
URLMacro |
string |
URL Macro that need to be tracked. |
data |
Object |
data to use for the URL Macro. |
VAST-macro :string
From VAST specification:
Sometimes ad servers would like to collect metadata from the video player when tracking event URIs are accessed. For example, the position of the video player playhead at the time a tracking event URI is accessed is useful to the ad server and is data that can only be known at the time of the prescribed tracking event. This data cannot be built into the URI at the time the VAST response is built and served.
The following macros enable the video player to provide certain details to the ad server at the time tracking URIs are accessed.
- [ERRORCODE]: replaced with one of the error codes listed in section 2.3.6.3 when the associated error occurs; reserved for error tracking URIs.
- [CONTENTPLAYHEAD]: replaced with the current time offset “HH:MM:SS.mmm” of the video content.
- [CACHEBUSTING]: replaced with a random 8-digit number.
- [ASSETURI]: replaced with the URI of the ad asset being played.
- [TIMESTAMP]: the date and time at which the URI using this macro is accessed. Used where ever a time stamp is needed, the macro is replaced with the date and time using the formatting conventions of ISO 8601. However, ISO 8601 does not provide a convention for adding milliseconds. To add milliseconds, use the convention .mmm at the end of the time provided and before any time zone indicator. For example, January 17, 2016 at 8:15:07 and 127 milliseconds, Eastern Time would be formatted as follows: 2016-01-17T8:15:07.127-05 When replacing macros, the video player must correctly percent-encode any characters as defined by RFC 3986. VAST doesn’t provide any guidance on URI format, but using the [CACHEBUSTING] macro simplifies trafficking, enabling ad servers to easily search and replace the appropriate macro for cache busting.
VastChain :Array.<VastResponse>
Array of VastResponse sorted backwards. Last response goes first. Represents the chain of VAST responses that ended up on a playable video ad or an error.
VastChainDetails :Object
VastChain details object. You can think of it as a summary of the VAST Chain. Useful for debugging purposes and tracking. for more info about the returned properties please check VAST specification
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
adId |
string |
<optional> |
the ad Id. See VAST spec for more info |
adServingId |
string |
<optional> |
the adServingId See VAST spec for more info |
adSystem |
string |
<optional> |
|
adTitle |
string |
<optional> |
ad title. |
advertiser |
string |
<optional> |
ad advertiser's name. |
adWrapperCreativeAdIds |
Array.<string> |
<optional> |
creative ad ids of the wrapper. |
adWrapperCreativeIds |
Array.<string> |
<optional> |
creative Ids of the wrappers. |
adWrapperIds |
Array.<string> |
<optional> |
ad ids of the wrappers. |
adWrapperSystems |
Array.<string> |
<optional> |
ad systems of the wrappers. |
category |
string |
<optional> |
ad category. |
categoryAuthority |
string |
<optional> |
ad category authority. |
clickThroughUrl |
string |
<optional> |
the inline ad clickThroughUr. |
creativeAdId |
string |
<optional> |
the ad id of the linear creative. |
creativeData |
string |
<optional> |
Object with the creativeData of the Ad. |
creativeId |
string |
<optional> |
the id of the linear creative. |
description |
string |
<optional> |
ad description. |
duration |
string |
<optional> |
the linear duration as it comes int the VAST XML |
durationInMs |
number |
<optional> |
the linear duration in milliseconds |
mediaFiles |
Array.<MediaFile> |
<optional> |
The linear ads MediaFiles |
pricing |
string |
<optional> |
the pricing of the ad if available |
pricingCurrency |
string |
<optional> |
the currency of the pricing if available. |
pricingModel |
string |
<optional> |
the pricing model if available. |
skipOffset |
string |
<optional> |
the linear skip offset as it comes int the VAST XML |
skipOffsetInMs |
number |
<optional> |
the linear skip offset in milliseconds |
skippable |
boolean |
<optional> |
true if the ad is skippable and false otherwise. |
universalAdId |
string |
<optional> |
Universal Ad Id of the ad. |
universalAdIdRegistry |
string |
<optional> |
registry of the Universal Ad Id of the ad. |
vastVersion |
string |
VAST version of the last VastResponse. If no version is found it will contain |
|
vpaid |
boolean |
<optional> |
if the VastChain has a linear ad, it will be true if it contains a VPAID creative and false otherwise. |
VastIcon :Object
VastIcon. For more info please take a look at the VAST specification
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
offset |
ParsedOffset |
<optional> |
The time of delay from when the associated linear creative begins playing to when the icon should be displayed. |
duration |
ParsedOffset |
<optional> |
The duration the icon should be displayed unless ad is finished playing. |
height |
number |
<optional> |
Pixel height of the icon. |
width |
number |
<optional> |
Pixel width of the icon. |
program |
string |
<optional> |
The program represented in the icon (e.g. "AdChoices"). |
pxratio |
number |
<optional> |
The pixel ratio for which the icon creative is intended. The pixel ratio is the ratio of physical pixels on the device to the device-independent pixels. An ad intended for display on a device with a pixel ratio that is twice that of a standard 1:1 pixel ratio would use the value "2." Default value is "1.". |
xPosition |
string | number |
<optional> |
The x-coordinate of the top, left corner of the icon asset relative to the ad display area. Values of "left" or "right" also accepted and indicate the leftmost or rightmost available position for the icon asset. |
yPosition |
string | number |
<optional> |
The y-coordinate of the top left corner of the icon asset relative to the ad display area. Values of "top" or "bottom" also accepted and indicate the topmost or bottom most available position for the icon asset |
staticResource |
string |
<optional> |
The URI to a static creative file to be used as the icon. |
htmlResource |
string |
<optional> |
The URI to a static creative file to be used as the icon. |
iFrameResource |
string |
<optional> |
The URI to a static creative file to be used as the icon. |
iconViewTracking |
Array.<string> |
<optional> |
Array of URIs for the tracking resource files to be called when the icon creative is displayed |
iconClickThrough |
string |
<optional> |
A URI to the industry program page opened when a viewer clicks the icon. |
iconClickTracking |
Array.<string> |
<optional> |
Array of URIs to the tracking resource files to be called when a click corresponding to the id attribute (if provided) occurs. |
VastResponse :Object
An Object representing a processed VAST response.
Properties:
Name | Type | Description |
---|---|---|
ad |
Object |
The selected ad extracted from the passed XML. |
parsedXML |
Object |
The XML parsed object. |
errorCode |
number |
VAST error code number to identify the error or null if there is no error. |
error |
Error |
Error instance with a human readable description of the error or undefined if there is no error. |
requestTag |
string |
Ad tag that was used to get this |
XML |
string |
RAW XML as it came from the server. |
VastTrackingEvent :Object
VastTrackingEvent. For more info please take a look at the VAST specification
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string |
<optional> |
A string that defines the event being track. |
offset |
ParsedOffset |
<optional> |
When the progress of the linear creative has matched the value specified, the included URI is triggered |
uri |
string |
<optional> |
A URI to the tracking resource for the event specified using the event attribute |
WrapperOptions :Object
Wrapper ad options.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
allowMultipleAds |
boolean |
<optional> |
a Boolean value that identifies whether multiple ads are allowed in the requested VAST response. If true, both Pods and stand-alone ads are allowed. If false, only the first stand-alone Ad (with no sequence values) in the requested VAST response is allowed. Default value is “false.” |
fallbackOnNoAd |
boolean |
<optional> |
a Boolean value that provides instruction for using an available Ad when the requested VAST response returns no ads. If true, the video player should select from any stand-alone ads available. If false and the Wrapper represents an Ad in a Pod, the video player should move on to the next Ad in a Pod; otherwise, the video player can follow through at its own discretion where no-ad responses are concerned. |
followAdditionalWrappers |
boolean |
<optional> |
s a Boolean value that identifies whether subsequent wrappers after a requested VAST response is allowed. If false, any Wrappers received (i.e. not an Inline VAST response) should be ignored. Otherwise, VAST Wrappers received should be accepted (default value is “true.”) |