Advertising


This API provides developers with more control over the functionality of the Advertising edition of JWP. For VAST and IMA plugins, this API allows for things like impression verification, custom scheduling, and multiple companions.

Endpoints

MethodDescription
.getAdBlock()Used to determine whether or not the player is detecting the presence of an ad blocker.
.loadAd(tag)Used to play an ad immediately, which is primarily useful for situations where the built-in ad schedule of JWP cannot be used (for example, for live streaming or dynamic ads for playlist items).
.loadAd(xml)Used to play an ad immediately, which is primarily useful for situations where the built-in ad schedule of JWP cannot be used (for example, for live streaming or dynamic ads for playlist items). This function is useful when you have already loaded the ad tag via some external mechanism and want to load the response into the player.
.pauseAd(state)Used to pause or resume ad playback.
.playAd(tag)Deprecated as of JW 8.31.0. Use loadAd(tag).

Used to play an ad immediately, which is primarily useful for situations where the built-in ad schedule of JWP cannot be used (for example, for live streaming or dynamic ads for playlist items)
.skipAd()Used to skip the currently playing ad. This allows developers to create their own controls for skipping ads. Works with IMA, VAST, and FreeWheel ad clients.


Events

MethodDescription
.on('adBidRequest')Fired when header bidding starts requesting for bids.
.on('adBidResponse')Fired when header bidding returns response.
.on('adBlock')This event is fired when an ad plugin (Either VAST or Google IMA) is configured inside of the JWP 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.
.on('adBreakEnd')Fires when control is passed back to the player from the ad.
.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
.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.
.on('adClick')VAST and IMA. Fired whenever a user clicks an ad to be redirected to its landing page.
.on('adCompanions')VAST and IMA. Fired whenever an ad contains companions.
.on('adComplete')Fired whenever an ad has completed playback.
.on('adError')Fired whenever an error prevents the ad from playing.
.on('adImpression')VAST, IMA. Fired based on the IAB definition of an ad impression. This occurs the instant a video ad begins to play.
.on('adItem')Fires when the VAST XML has been parsed, loaded, and is ready for display
.on('adLoaded')Fires when the VAST XML has been parsed, loaded, and is ready for display
.on('adManager')Starting with JWP 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.
.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.
.on('adPause')Fired whenever an ad is paused.
.on('adPlay')Fired whenever an ad starts playing or when an ad is unpaused.
.on('adRequest')Fired whenever an ad is requested by the player.
.on('adRequestedContentResume')Fired when one of the following events occurs: an ad completes, an error is triggered, or the ad is skipped
.on('adSchedule')VAST only. Fires when the ad schedule is loaded and parsed by the plugin.
.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.
.on('adStarted')(VPAID - VAST, FW | all ads - IMA) This API will trigger when an ad creative signals to our player that it is starting.
.on('adTime')Fired while ad playback is in progress.
.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.
.on('adWarning')VAST only. Signals a non-fatal warning that is not critical to the playback of an ad.
.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.
.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().
.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().


© 2007-2024 Longtail Ad Solutions, Inc.