Advertising
Video ad insertion requires a JW Player Enterprise license. Please contact our team to upgrade your account.
This API provides developers with more control over the functionality of the Advertising edition of JW Player. For VAST and IMA plugins, this API allows for things like impression verification, custom scheduling, and multiple companions.
.on('adBidRequest')
Fired when header bidding starts requesting for bids.
Returns an object with the following:
Value | Description |
---|---|
bidders array | An array of all bidders in the current bid request. |
bidTimeout number | The amount of milliseconds it will wait for the bids to return after user clicks to play. |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
floorPriceCents number | Floor price that the return bids need to beat to play. Not returned when using dfp mediation layer |
floorPriceCurrency string | The currency of the floor price cents value. Needs to be usd for Facebook. Only used for Facebook bids when mediation layer is set to jwp . |
mediationLayerAdServer string | The mediation layer, which is the decision-maker in what ad to run Possible Values: • dfp • jwp • jwpdfp • jwpspotx |
offset string | The offset of the ad |
type string | The type of the event This will always return adBidRequest |
viewable number | If the player is viewable or not. Possible Values: • 0 • 1 |
Each bidder object contains the following:
Value | Description |
---|---|
id number | The publisher ID used for header bidding for each of the bidder |
name string | The name of the bidder Possible Values: See: advertising.bids.bidders[].name |
.on('adBidResponse')
Fired when header bidding returns response.
Return an object with the following:
Value | Description |
---|---|
bidders array | An array of all bidders in the current bid request. |
bidTimeout number | The amount of milliseconds it will wait for the bids to return after user clicks to play. |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
floorPriceCents number | Floor price that the return bids need to beat to play. Not returned when using dfp mediation layer |
floorPriceCurrency string | The currency of the floor price cents value. Needs to be usd for Facebook. Only used for Facebook bids when mediation layer is set to jwp . |
mediationLayerAdServer string | The mediation layer, which is the decision-maker in what ad to run Possible Values: • dfp • jwp • jwpdfp • jwpspotx |
offset string | The offset of the ad |
placement string | Value sent in a bid request that identifies the location of a player Possible Values: • article • banner • feed • floating • instream • interstitial • slider |
type string | The type of the event This will always return adBidResponse |
viewable number | If the player is viewable or not. Possible Values: • 0 • 1 |
Bidder Object
Each bidder object contains the following:
Value | Description |
---|---|
id number | The publisher ID used for header bidding for each of the bidder |
name string | The name of the bidder Possible Values: See: advertising.bids.bidders[].name |
priceInCents number | The price of the bid. Only used when JW Player is the mediation layer |
result string | The result of the bidder's bid Possible Values: • bid • noBid • timeout |
tagKey number | The tagKey of the bid returned.Only used for SpotX bidder |
timeForBidResponse number | Time taken for the bid to return in milliseconds |
winner boolean | Set to true when the bidder is the winning bid Possible Values: • false • true |
.on('adBlock')
This event is fired when an ad plugin (Either VAST or Google IMA) is configured inside of the JW Player setup, and an ad blocker is detected on a viewer's browser. It is then possible to request a user disable their ad blocker to proceed.
Value | Description | Type |
---|---|---|
- | No value returned | - |
.on('adBreakEnd')
Fires when control is passed back to the player from the ad.
Returns an object with the following:
Value | Description |
---|---|
adposition string | An ad's position. Possible Values: • mid • post • pre |
client string | The ad client in use for the ad break. Possible Values: • dai • freewheel • googima • vast |
type string | The type of the event is firing This will always return adBreakEnd |
viewable number | If the player is viewable or not. Possible Values: • 0 : The player is below 50% or is in an inactive tab• 1 : The player is at least 50% in view and is in the active tab |
.on('adBreakIgnored')
(VAST only) Fires when the time elapsed between the previous fully-watched ad break and the current ad break is less than the value defined by advertising.rules.timeBetweenAds
Returns an object with the following content.
{
"id": "adbreak2",
"tag": "{ad_tag_url}",
"offset": 6,
"timeSinceLastAd": 3.256,
"type": "adBreakIgnored"
}
Value | Description |
---|---|
id string | Descriptive name of the ad break |
offset number | string | Position of an ad Possible Values: • {number in seconds} (This occurs for mid-roll ad breaks.) • post • pre |
tag string | URL of the ad tag |
timeSinceLastAd number | Duration between the current ad break and the saved time of the last ad break This value will always be less than the advertising.rules.timeBetweenAds value. |
type string | The type of the event is firing This will always return adBreakIgnored |
.on('adBreakStart')
Fires after the ad request and immediately before the ad is loaded into the player. Only fires before the first ad inside of an ad break.
Returns an object with the following:
Value | Description |
---|---|
adposition string | An ad's position. Possible Values: • mid • post • pre |
client string | The ad client in use for the ad break. Possible Values: • dai • freewheel • googima • vast |
type string | The type of the event is firing This will always return adBreakStart |
viewable number | If the player is viewable or not. Possible Values: • 0 : The player is below 50% or is in an inactive tab• 1 : The player is at least 50% in view and is in the active tab |
.on('adClick')
VAST and IMA. Fired whenever a user clicks an ad to be redirected to its landing page.
Returns an object with the following:
Value | Description |
---|---|
clickThroughUrl string | The redirect URL |
client string | The ad client in use for the ad break. Possible Values: • dai • freewheel • googima • vast |
creativetype string | The type of ad that is just completed |
tag string | The URL of the ad tag that just completed |
.on('adCompanions')
VAST and IMA. Fired whenever an ad contains companions.
Returns an object with the following:
Value | Description | |
---|---|---|
companions array | An array with available companion information | |
tag string | The URL of the ad tag that is currently playing |
Every companion will return the following object:
Value | Description |
---|---|
click string | URL to link to when clicking the companion. Only available if the type is static |
creativeview array | An array of included creativeview event tracking pixels |
height number | The height of the companion in pixels |
resource string | The URL to the static/iframe resource, or the raw HTML content |
type string | The type of the creative: static, iframe, or HTML |
width number | The width of the companion in pixels |
.on('adComplete')
Fired whenever an ad has completed playback.
Returns an object with the following:
Value | Description |
---|---|
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
creativetype string | The type of ad that is just completed |
tag string | The URL of the ad tag that just completed |
viewable number | If the player is viewable or not. Possible Values: • 0 • 1 |
.on('adError')
Fired whenever an error prevents the ad from playing.
This may fire multiple times for a single ad tag if Google IMA is being used.
Returns an object with the following at a minimum*:
Value | Description |
---|---|
message string | The ad error message. See table below. |
tag string | The URL of the ad tag that produced the error |
Possible Error Messages | Causes |
---|---|
ad tag empty | No ad was available after searching wrapped ad tags |
error playing creative | 404 on a creative file |
error loading ad tag | All additional ad errors |
invalid ad tag | Invalid XML, Improperly formatted VAST syntax |
no compatible creatives | FLV video creative or VPAID SWF is attempting to play in HTML5 player |
.on('adImpression')
VAST, IMA. Fired based on the IAB definition of an ad impression. This occurs the instant a video ad begins to play.
Returns an object with the following:
Value | Description |
---|---|
adposition string | An ad's position. Possible Values: • mid • post • pre |
adsystem string | AdSystem referenced inside of the VAST XML |
adtitle string | AdTitle referenced inside of the VAST XML |
bidders array | IMA-only An array of bidders who made bids on the ad slot. Only added if header bidding happened Look at bidder object for what is contained in each bidder object. |
clickThroughUrl string | The URL of the page the user lands on when clicking the ad |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
creativetype string | VAST-only The MIME type of the current media file specified in the VAST XML |
duration number | The total duration of the ad creative |
linear string | Returns if an ad is linear or nonlinear |
mediafile object | VAST-only An object containing "file", which is the currently playing media item |
tag string | The URL of the ad tag that was started |
timeLoading number | The time in milliseconds the ad took to load |
vastversion number | VAST-only The version of VAST referenced in the VAST XML |
viewable number | If the player is viewable or not. Possible Values: • 0 : Not viewable• 1 : Viewable |
wrapper array | VAST-only An array of the AdSystems specified in any utilized ad wrappers; index denotes level of wrapper |
.on('adItem')
Fires when the VAST XML has been parsed, loaded, and is ready for display
Returns an object containing the following content:
{
"client": "googima",
"placement": 1,
"viewable": 1,
"adposition": "pre",
"tag": "{ad_tag_url}",
"adBreakId": "1a2b3c4d5e6f",
"adPlayId": "1a2b3c4d5e6f",
"id": "1a2b3c4d5e6f",
"ima": {
...
},
"adtitle": "LinearInlineSkippable",
"adsystem": "GDFP",
"creativetype": "video/mp4",
"duration": 10,
"linear": "linear",
"description": "LinearInlineSkippable ad",
"creativeAdId": "",
"adId": "123456789",
"universalAdId": [{
...
}],
"advertiser": "",
"dealId": "",
"mediaFile": {
"file": "{linear_ad_video_file_url}"
},
"type": "adItem"
}
{
"client": "vast",
"placement": 1,
"adBreakId": "6f5e4d3c2b1a",
"adPlayId": "6f5e4d3c2b1a",
"offset": "pre",
"item": {
...
},
"type": "adItem"
}
Property | Description |
---|---|
adBreakId string | Unique ID for each ad break If there are multiple ads in the same ad break, all of the ads will have the same adBreakId . |
adId string | From the ad XML, identity of the ad server that provides the creative Definition derived from IAB Tech Lab |
adPlayId string | Unique ID for each ad If there are multiple ads in the same ad break, each ad has a different adPlayId . |
adposition string | Position of the ad Possible Values: • mid • post • pre |
adsystem string | From the ad XML, name of the ad server that returned the ad Definition derived from IAB Tech Lab |
adtitle string | From the ad XML, common name for the ad Definition derived from IAB Tech Lab |
advertiser string | From the ad XML, name of the advertiser as defined by the ad serving party Definition derived from IAB Tech Lab |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
creativeAdId string | From the ad XML, the ad server’s unique identifier for the creative Definition derived from IAB Tech Lab |
creativetype string | MIME type of the current media file specified in the VAST XML |
dealId string | From the ad XML, returns the first deal ID present in the wrapper chain for the current ad, starting from the top Definition derived from Google |
description string | From the ad XML, provides a long ad description Definition derived from IAB Tech Lab |
duration number | From the ad XML, time value for the duration of the linear ad in the format HH:MM:SS.mmm Definition derived from IAB Tech Lab |
id string | Unique ad ID |
ima object | Contains the currently playing ad instance from the IMA SDK, and the userRequestContext that JW Player passes to the IMA SDK when requesting an ad |
item object | Playlist item that is currently being played as the content |
linear string | Value of the linear attribute of the ad XMLPossible Values: • linear • nonlinear |
mediaFile object | From the ad XML, contains the video file for a linear ad Definition derived from IAB Tech Lab |
offset number | string | Position of an ad Possible Values: • {number in seconds} (This occurs for mid-roll ads) • post • pre |
placement string | Value sent in a bid request that identifies the location of a player Possible Values: • article • banner • feed • floating • instream • interstitial • slider |
sequence number | Returns the sequence number with which the ad associated |
tag string | URL of the ad tag |
type string | Category of the player event This is always adItem for the event. |
universalAdId object | From the ad XML, unique creative identifier that is maintained across systems for the purpose of tracking ad creative Definition derived from IAB Tech Lab |
viewable number | Indicates if the player is viewable or not Possible Values: • 0 • 1 |
.on('adLoaded')
Fires when the VAST XML has been parsed, loaded, and is ready for display
Returns an object containing the following content:
{
"client": "googima",
"placement": 1,
"viewable": 1,
"adposition": "pre",
"tag": "{ad_tag_url}",
"adBreakId": "1a3c2b4d5e6f",
"adPlayId": "1a3c2b4d5e6f",
"id": "1a3c2b4d5e6f",
"ima": {
...
},
"adtitle": "",
"adsystem": "GDFP",
"creativetype": "video/mp4",
"duration": 10,
"linear": "linear",
"description": "",
"creativeAdId": "",
"adId": "232859236",
"universalAdId": [],
"advertiser": "",
"dealId": "",
"mediaFile": {
"file": "{linear_ad_video_file_url}"
},
"type": "adLoaded"
}
{
"client": "vast",
"placement": 1,
"adBreakId": "1a2b3c4d5e6f",
"adPlayId": "1a2b3c4d5e6f",
"offset": "pre",
"id": "dlsjb0-test",
"tag": "{ad_tag_url}",
"adposition": "pre",
"sequence": 1,
"witem": 1,
"wcount": 1,
"adsystem": "",
"adschedule": {
...
},
"item": {
...
},
"timeLoading": 57,
"type": "adLoaded"
}
Property | Description |
---|---|
adBreakId string | Unique ID for each ad break If there are multiple ads in the same ad break, all of the ads will have the same adBreakId . |
adId string | From the ad XML, identity of the ad server that provides the creative Definition derived from IAB Tech Lab |
adPlayId string | Unique ID for each ad If there are multiple ads in the same ad break, each ad has a different adPlayId . |
adposition string | Position of the ad Possible Values: • mid • post • pre |
adschedule object | Ad break information |
adsystem string | From the ad XML, name of the ad server that returned the ad |
adtitle string | From the ad XML, common name for the ad Definition derived from IAB Tech Lab |
advertiser string | From the ad XML, name of the advertiser as defined by the ad serving party Definition derived from IAB Tech Lab |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
creativeAdId string | From the ad XML, the ad server’s unique identifier for the creative Definition derived from IAB Tech Lab |
creativetype string | MIME type of the current media file specified in the ad XML |
dealId string | From the ad XML, returns the first deal ID present in the wrapper chain for the current ad, starting from the top Definition derived from Google |
description string | From the ad XML, provides a long ad description Definition derived from IAB Tech Lab |
duration number | From the ad XML, time value for the duration of the linear ad in the format HH:MM:SS.mmm Definition derived from IAB Tech Lab |
id string | Unique ad ID |
ima object | Contains the currently playing ad instance from the IMA SDK, and the userRequestContext that JW Player passes to the IMA SDK when requesting an ad |
item object | Playlist item that is currently being played as the content |
linear string | Value of the linear attribute of the ad XMLPossible Values: • linear • nonlinear |
mediaFile object | From the ad XML, contains the video file for a linear ad Definition derived from IAB Tech Lab |
offset number | string | Position of an ad Possible Values: • {number in seconds} (This occurs for mid-roll ads) • post • pre |
placement string | Value sent in a bid request that identifies the location of a player Possible Values: • article • banner • feed • floating • instream • interstitial • slider |
sequence number | Returns the sequence number with which the ad associated |
tag string | URL of the ad tag |
timeLoading integer | Time the ad took to load in milliseconds |
type string | Category of the player event This is always adLoaded for the event. |
universalAdId object | From the ad XML, unique creative identifier that is maintained across systems for the purpose of tracking ad creative Definition derived from IAB Tech Lab |
viewable number | Indicates if the player is viewable or not Possible Values: • 0 • 1 |
wcount number | Waterfall count |
witem number | Waterfall index |
.on('adManager')
Starting with JW Player 8.8.0, use .on('adsManager')
FreeWheel only. Fires when the ad manager is loaded into the player.
This event allows publishers to integrate additional FreeWheel ad manager functionality before ad playback.
Response
This event returns an object similar to the following:
{
"adManager": {...},
"type": "adManager"
}
Value | Description |
---|---|
adManager object | Object containing the ad manager configuration |
type string | Category of the player event This is always adManager for this event. |
.on('adMeta')
VAST only. Continuously triggers when new metadata has been received from the ad by the player. Values may vary based on the ad itself.
Returns an object with the following:
Value | Description |
---|---|
metadata object | Object containing the metadata from the ad The values contained within the object will vary based on the ad. |
.on('adPause')
Fired whenever an ad is paused.
Returns an object with the following:
Value | Description |
---|---|
creativetype string | VAST-only The MIME type of the current media file specified in the VAST XML |
newstate string | The new state of the player This should be "paused" |
oldstate string | The state of the player prior to ad pause |
pauseReason 8.7.0+ string | Reason ad playback has been paused Possible Values: • clickthrough : Viewer clicked an ad• external : Native VPAID controls or jwplayer().pauseAd() • interaction : Viewer clicked the pause control on the player |
tag string | The URL of the ad tag that is currently playing. |
viewable number | If the player is viewable or not. Possible Values: • 0 : Not viewable• 1 : Viewable |
.on('adPlay')
Fired whenever an ad starts playing or when an ad is unpaused.
Returns an object with the following:
Value | Description |
---|---|
creativetype string | VAST-only The MIME type of the current media file specified in the VAST XML |
newstate string | The new state of the player This should be "playing" |
oldstate string | The state of the player prior to ad play |
tag string | The URL of the ad tag that is currently playing. |
viewable number | If the player is viewable or not. Possible Values: • 0 : Not viewable• 1 : Viewable |
.on('adRequest')
Fired whenever an ad is requested by the player.
Returns an object with the following:
Value | Description |
---|---|
adposition string | An ad's position. Possible Values: • mid • pre • post |
client string | The client that is currently being used Possible Values: • freewheel • googima • vast |
offset number | string | An ad's position. Will return a number (in seconds) of a midroll's position Possible Values: • {number} • post • pre |
tag string | The URL of the ad tag that is being requested |
viewable number | If the player is viewable or not. Possible Values: • 0 : Not viewable• 1 : Viewable |
.on('adSchedule')
VAST only. Fires when the ad schedule is loaded and parsed by the plugin.
Returns an object with the following:
Value | Description |
---|---|
adbreaks array | An array of objects, each containing information about an ad break. |
client string | The ad client in use for the ad schedule Possible Values: • freewheel • googima • vast |
placement string | Value sent in a bid request that identifies the location of a player Possible Values: • article • banner • feed • floating • instream • interstitial • slider |
tag string | The URL of the ad schedule. |
.on('adLoadedXML')
VAST only. Fires when the VAST ad client loads an ad tag. The response contains an XML parameter that exposes the XML downloaded from the tag as well as the same object properties as other ad events, such as adBreakId
, adPlayId
, adPosition
, client
, and tag
.
.on('adSkipped')
(VAST, IMA) Fired whenever an ad has been skipped.
Returns an object with the following:
Value | Description |
---|---|
client string | The client that is currently being used Possible Values: • freewheel • googima • vast |
creativetype string | The type of ad that was skipped |
tag string | The URL of the ad tag that was skipped |
.on('adStarted')
(VPAID - VAST, FW | all ads - IMA) This API will trigger when an ad creative signals to our player that it is starting.
Returns an object with the following:
Value | Description |
---|---|
creativetype string | The MIME type of the VPAID creative |
tag string | The URL of the ad tag that was started. |
viewable number | If the player is viewable or not. Possible Values: • 0 : Not viewable• 1 : Viewable |
.on('adTime')
Fired while ad playback is in progress.
Returns an object with the following:
Value | Description |
---|---|
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
creativetype string | (VAST only) The MIME type of the current media file specified in the VAST XML |
duration number | The total duration of the ad creative |
position number | The current playback position in the ad creative in seconds |
sequence number | Returns the sequence number the ad is a part of |
tag string | The URL of the ad tag that is currently playing |
viewable number | If the player is viewable or not. Possible Values: • 0 • 1 |
.on('adViewableImpression')
VAST and IMA. Fires only when both of the following conditions are met:
- Ad has played for two consecutive seconds
- At least 50% of the player is in the viewport.
Use the adViewableImpression
to track the viewability of your ad impressions. The ad viewable impressions metric is comparable to Google's TrueView viewable impression metric.
Returns an object with the following:
{
"client": "googima",
"placement": 1,
"viewable": 1,
"adposition": "pre",
"tag": "{google_ad_tag}",
"adBreakId": "1a2b3c4d5e6f",
"adPlayId": "1a2b3c4d5e6f",
"id": "1a2b3c4d5e6f",
"ima": {
...
},
"adtitle": "External Linear Inline",
"adsystem": "GDFP",
"creativetype": "video/mp4",
"duration": 10,
"linear": "linear",
"description": "External Linear Inline ad",
"creativeAdId": "",
"adId": "697x312-p",
"universalAdId": [{
...
}],
"advertiser": "",
"dealId": "",
"mediaFile": {
...
},
"type": "adViewableImpression"
}
{
"client": "vast",
"placement": 1,
"adBreakId": "f61a2b3c4d5e",
"adPlayId": "f61a2b3c4d5e",
"offset": "pre",
"id": "f61a2b3c4d5e",
"tag": "{ad_tag_url}",
"adposition": "pre",
"sequence": 1,
"witem": 1,
"wcount": 1,
"adsystem": "Ad System",
"adschedule": {
...
},
"adtitle": "VPAID 2 Linear",
"description": "VPAID 2 Linear Video Ad",
"adId": "1234567",
"advertiser": "",
"advertiserId": "",
"creativeId": "",
"creativeAdId": "",
"dealId": "",
"request": {},
"response": {
...
},
"conditionalAdOptOut": false,
"vastversion": 3,
"clickThroughUrl": "https://click-through-url.com",
"mediaFileCompliance": true,
"mediafile": {
...
},
"viewable": 1,
"creativetype": "application/javascript",
"type": "adViewableImpression"
}
Property | Description |
---|---|
adBreakId string | Unique ID for each ad break If there are multiple ads in the same ad break, all of the ads will have the same adBreakId . |
adId string | From the ad XML, identity of the ad server that provides the creative Definition derived from IAB Tech Lab |
adPlayId string | Unique ID for each ad If there are multiple ads in the same ad break, each ad has a different adPlayId . |
adposition string | Position of the ad Possible Values: • mid • post • pre |
adschedule object | Ad break information |
adsystem string | From the ad XML, name of the ad server that returned the ad Definition derived from IAB Tech Lab |
adtitle string | From the ad XML, common name for the ad Definition derived from IAB Tech Lab |
advertiser string | From the ad XML, name of the advertiser as defined by the ad serving party Definition derived from IAB Tech Lab |
advertiserId string | From the ad XML, optional identifier for the advertiser, provided by the ad server Definition derived from IAB Tech Lab |
clickThroughUrl string | From the ad XML, URI to the advertiser’s site that the media player opens when a viewer clicks the ad Definition derived from IAB Tech Lab |
client string | The client that is currently being used Possible Values: • dai • freewheel • googima • vast |
conditionalAdOptOut boolean | (VPAID-only) Used to tell the player to not play ads with the conditionalAd attribute inside of the VAST response |
creativeId string | From the ad XML, identifier of the ad server that provides the creative Definition derived from IAB Tech Lab |
creativeAdId string | From the ad XML, the ad server’s unique identifier for the creative Definition derived from IAB Tech Lab |
creativetype string | MIME type of the current media file specified in the VAST XML |
dealId string | From the ad XML, returns the first deal ID present in the wrapper chain for the current ad, starting from the top Definition derived from Google |
description string | From the ad XML, provides a long ad description Definition derived from IAB Tech Lab |
duration number | From the ad XML, time value for the duration of the linear ad in the format HH:MM:SS.mmm Definition derived from IAB Tech Lab |
id string | Unique ad ID |
ima object | Contains the currently playing ad instance from the IMA SDK, and the userRequestContext that JW Player passes to the IMA SDK when requesting an ad |
linear string | Value of the linear attribute of the ad XMLPossible Values: • linear • nonlinear |
mediafile | mediaFile object | From the ad XML, contains the video file for a linear ad Definition derived from IAB Tech Lab |
mediaFileCompliance boolean | Indicates if the ad is mediaFile compliantTo be compliant, one of the following conditions must be met: • .m3u8 • VPAID • At least three quality level per MIME type |
offset string | Position of an ad Possible Values: • {number in seconds} (This occurs for mid-roll ads) • post • pre |
placement string | Value sent in a bid request that identifies the location of a player Possible Values: • article • banner • feed • floating • instream • interstitial • slider |
request object | XML HTTP request to the ad tag URL |
response object | XML response received from the request |
sequence number | Returns the sequence number with which the ad associated |
tag string | URL of the ad tag |
type string | Category of the player event This is always adViewabilityImpression for the event. |
universalAdId object | From the ad XML, unique creative identifier that is maintained across systems for the purpose of tracking ad creative Definition derived from IAB Tech Lab |
vastversion number | From the ad XML, official version with which the VAST response is compliant Definition derived from IAB Tech Lab |
viewable number | Indicates if the player is viewable or not Possible Values: • 0 • 1 |
wcount number | Waterfall count |
witem number | Waterfall index |
.on('adWarning')
VAST only. Signals a non-fatal warning that is not critical to the playback of an ad.
{
"message": "Tracking events are missing breakStart, breakEnd, or error for AdBreak",
"code": 1002,
"adErrorCode": 70001,
"type": "adWarning",
"tag": "{ad_tag_url}"
}
Value | Description |
---|---|
adErrorCode number | JW Player ad warning code |
code number | VAST warning code |
message string | Ad error message |
tag string | URL of the ad tag that produced the error |
type string | Category of player event This is always adWarning for this event. |
.on('adsManager')
Fires when the ad manager is loaded into the player.
This event allows publishers to integrate additional ad manager functionality before ad playback.
Using this event to integrate additional functionality could impact ad playback.
Response
This event returns an object similar to the following:
{
"adsManager": {...},
"type": "adsManager",
"videoElement": {}
}
Value | Description |
---|---|
adsManager object | Object containing the ad manager configuration See Google's and FreeWheel's documentation for the properties returned by the respective SDK. |
type string | Category of the player event This is always adsManager for this event. |
videoElement object | (IMA only) Video tag used for playback |
.on('beforeComplete')
Fired just before the player completes playing. Unlike the onComplete event, the player will not have moved on to either showing the replay screen or advancing to the next playlistItem, which makes this the right moment to insert post-roll ads using playAd()
.
Value | Description | Type |
---|---|---|
- | No value returned | - |
.on('beforePlay')
Fired just before the player begins playing. Unlike the onPlay event
, the player will not have begun playing or buffering when triggered, which makes this the right moment to insert preroll ads using playAd()
.
Value | Description | Type |
---|---|---|
- | No value returned | - |