Class: AdsRequest

Constructor

AdsRequest

new AdsRequest()

Implements
google.ima.AdsRequestData

Properties

adsResponse

(string or nullable Document)

Specifies a VAST 2.0 document to be used as the ads response instead of making a request via an ad tag url. This can be useful for debugging and other situations where a VAST response is already available.

This parameter is optional.

adTagUrl

string

Specifies the ad tag url that is requested from the ad server. For details on constructing the ad tag url, see Create a master video tag manually.

This parameter is required.

contentDuration

nullable number

Specifies the duration of the content in seconds to be shown. Used in AdX requests.

This parameter is optional.

contentKeywords

nullable Array of string

Specifies the keywords used to describe the content to be shown. Used in AdX requests.

This parameter is optional.

contentTitle

nullable string

Specifies the title of the content to be shown. Used in AdX requests.

This parameter is optional.

forceNonLinearFullSlot

boolean

Forces non-linear AdSense ads to render as linear fullslot. If set, the content video will be paused and the non-linear text or image ad will be rendered as fullslot. The content video will resume once the ad has been skipped or closed.

linearAdSlotHeight

number

Specifies the height of the rectangular area within which a linear ad is displayed. This value is used as one of the criteria for ads selection. This value does not need to match actual ad's height.

This parameter is required.

linearAdSlotWidth

number

Specifies the width of the rectangular area within which a linear ad is displayed. This value is used as one of the criteria for ads selection. This value does not need to match actual ad's width.

This parameter is required.

liveStreamPrefetchSeconds

number

Specifies the maximum amount of time to wait in seconds, after calling requestAds, before requesting the ad tag URL. This can be used to stagger requests during a live-stream event, in order to mitigate spikes in the number of requests.

nonLinearAdSlotHeight

number

Specifies the height of the rectangular area within which a non linear ad is displayed. This value is used as one of the criteria for ads selection. This value does not need to match actual ad's height.

This parameter is required.

nonLinearAdSlotWidth

number

Specifies the width of the rectangular area within which a non linear ad is displayed. This value is used as one of the criteria for ads selection. This value does not need to match actual ad's width.

This parameter is required.

vastLoadTimeout

number

Override for default VAST load timeout in milliseconds for a single wrapper. The default timeout is 5000ms.

This parameter is optional.

Methods

setAdWillAutoPlay

setAdWillAutoPlay(autoPlay)

Notifies the SDK whether the player intends to start the content and ad in response to a user action or whether it will be automatically played. Changing this setting will have no impact on ad playback.

Parameter

autoPlay

boolean

Whether the content and the ad will be autoplayed or whether it will be started by a user action.

setAdWillPlayMuted

setAdWillPlayMuted(muted)

Notifies the SDK whether the player intends to start ad while muted. Changing this setting will have no impact on ad playback, but will send the appropriate signal in the ad request to allow buyers to bid on muted inventory.

Parameter

muted

boolean

Whether the ad will be played while muted.

setContinuousPlayback

setContinuousPlayback(continuousPlayback)

Notifies the SDK whether the player intends to continuously play the content videos one after another similar to TV broadcast. Changing this setting will have no impact on the ad playback, but will send the appropriate signal in this ad request to allow buyers to bid on the type of ad inventory.

Parameter

continuousPlayback

boolean

Whether the content video is played one after another continuously.