Methods
(static) getDetails(vastChain) → {VastChainDetails}
Returns a summary of the passed VastChain.
Parameters:
Name | Type | Description |
---|---|---|
vastChain |
VastChain |
the VastChain from which we want the details. |
- Source:
(async, static) requestAd(adTag, options, vastChainopt) → {Promise.<VastChain>}
Request the ad using the passed ad tag and returns an array with the VAST responses needed to get an inline ad.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adTag |
string |
The VAST ad tag request url. |
|||||||||||||||||
options |
Object |
Options Map. The allowed properties are: Properties
|
|||||||||||||||||
vastChain |
VastChain |
<optional> |
Optional vastChain with the previous VAST responses. |
- Source:
(async, static) requestNextAd(VastChain, options) → {Promise.<VastChain>}
Requests the next ad in the VAST Chain.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VastChain |
VastChain |
Array of VastResponse. |
||||||||||||||||||||||||||||
options |
Object |
Options Map. The allowed properties are: Properties
|
- Source:
(async, static) run(vastChain, placeholder, optionsopt) → {Promise.<(VastAdUnit|VpaidAdUnit)>}
Will try to start video ad in the passed VastChain and return the started VideoAdUnit.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vastChain |
VastChain |
The VastChain with all the VastResponses. |
|||||||||||||||||||||||||||||||||||||||||||||
placeholder |
HTMLElement |
placeholder element that will contain the video ad. |
|||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Options Map. The allowed properties are: Properties
|
- Source:
Throws:
if there is an error starting the ad or it times out (by throw I mean that it will reject promise with the error).
(static) runWaterfall(adTag, placeholder, optionsopt) → {function}
Will try to start one of the ads returned by the adTag
. It will keep trying until it times out or it runs out of ads.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adTag |
string |
The VAST ad tag request url. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
placeholder |
HTMLElement |
placeholder element that will contain the video ad. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Options Map. The allowed properties are: Properties
|
- Source: