AdsRequest

interface AdsRequest : BaseRequest


An object containing the data used to request ads from the server.

Summary

Public functions

String!

Returns the URL from which ads will be requested.

ContentProgressProvider!

Returns the progress provider that will be used to schedule ad breaks.

String!

This function is deprecated.

Extra parameters are not used by the SDK.

(Mutable)Map<String!, String!>!

This function is deprecated.

Extra parameters are not used by the SDK.

Unit
setAdTagUrl(adTagUrl: String!)

Sets the URL from which ads will be requested.

Unit
setAdWillAutoPlay(willAutoPlay: Boolean)

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.

Unit
setAdWillPlayMuted(willPlayMuted: Boolean)

Notifies the SDK whether the player intends to start the content and ad while muted.

Unit
setAdsResponse(cannedAdResponse: String!)

Specifies a VAST, VMAP, or ad rules response to be used instead of making a request through an ad tag URL.

Unit

Specifies the duration of the content in seconds to be shown.

Unit

Specifies the keywords used to describe the content to be shown.

Unit
setContentProgressProvider(
    contentProgressProvider: ContentProgressProvider!
)

Attaches a ContentProgressProvider instance to allow scheduling ad breaks based on content progress (cue points).

Unit

Specifies the title of the content to be shown.

Unit
setContinuousPlayback(continuousPlayback: Boolean)

Notifies the SDK whether the player intends to continuously play the content videos one after another similar to TV broadcast.

Unit
setExtraParameter(key: String!, value: String!)

This function is deprecated.

Extra parameters are not used by the SDK.

Unit

Specifies the maximum amount of time to wait in seconds, after calling requestAds, before requesting the ad tag URL.

Unit

Specifies the VAST load timeout in milliseconds for a single wrapper.

Inherited functions

From com.google.ads.interactivemedia.v3.api.BaseRequest
String!

Returns the deep link to the content's screen provided in setContentUrl()

SecureSignals?

Returns the Secure Signals with custom data

Any!

Returns the user-provided object that is associated with the request.

Unit

Specifies the deep link to the content's screen.

Unit

Specifies the Secure Signals with custom data for this request.

Unit
setUserRequestContext(userRequestContext: Any!)

Sets the user-provided object that is associated with the request.

Public functions

getAdTagUrl

fun getAdTagUrl(): String!

Returns the URL from which ads will be requested.

getContentProgressProvider

fun getContentProgressProvider(): ContentProgressProvider!

Returns the progress provider that will be used to schedule ad breaks.

getExtraParameter

fun getExtraParameter(key: String!): String!

Returns null, this is a no-op.

getExtraParameters

fun getExtraParameters(): (Mutable)Map<String!, String!>!

Returns null, this is a no-op.

setAdTagUrl

fun setAdTagUrl(adTagUrl: String!): Unit

Sets the URL from which ads will be requested. For details on constructing the ad tag url, see Create a main ad video tag manually. Either this or an ads response is required.

setAdWillAutoPlay

fun setAdWillAutoPlay(willAutoPlay: Boolean): Unit

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. Not calling this function leaves the setting as unknown. Note: Changing this setting will have no impact on ad playback.

Parameters
willAutoPlay: Boolean

Set to true if the ad will be autoplayed by the player, or false if playback is triggered by a user response.

setAdWillPlayMuted

fun setAdWillPlayMuted(willPlayMuted: Boolean): Unit

Notifies the SDK whether the player intends to start the content and ad while muted. Not calling this function leaves the setting as unknown. Note: Changing this setting will have no impact on ad playback.

Parameters
willPlayMuted: Boolean

Set to true if the ad will be played while muted, or false if the ad will have volume greater than 0.

setAdsResponse

fun setAdsResponse(cannedAdResponse: String!): Unit

Specifies a VAST, VMAP, or ad rules response to be used instead of making a request through an ad tag URL. This can be useful for debugging and other situations in which an ad response is already available. Either this or an ad tag URL is required.

setContentDuration

fun setContentDuration(duration: Float): Unit

Specifies the duration of the content in seconds to be shown. This optional parameter is used by AdX requests. It is recommended for AdX users.

setContentKeywords

fun setContentKeywords(keywords: (Mutable)List<String!>!): Unit

Specifies the keywords used to describe the content to be shown. This optional parameter is used by AdX requests and is recommended for AdX users.

setContentProgressProvider

fun setContentProgressProvider(
    contentProgressProvider: ContentProgressProvider!
): Unit

Attaches a ContentProgressProvider instance to allow scheduling ad breaks based on content progress (cue points).

setContentTitle

fun setContentTitle(title: String!): Unit

Specifies the title of the content to be shown. Used in AdX requests. This optional parameter is used by AdX requests and is recommended for AdX users.

setContinuousPlayback

fun setContinuousPlayback(continuousPlayback: Boolean): Unit

Notifies the SDK whether the player intends to continuously play the content videos one after another similar to TV broadcast. Not calling this function leaves the setting as unknown. Note: Changing this setting will have no impact on ad playback.

Parameters
continuousPlayback: Boolean

Set to true if the content video is played one after another continuously.

setExtraParameter

fun setExtraParameter(key: String!, value: String!): Unit

No-op.

setLiveStreamPrefetchSeconds

fun setLiveStreamPrefetchSeconds(prefetchTime: Float): Unit

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.

setVastLoadTimeout

fun setVastLoadTimeout(timeout: Float): Unit

Specifies the VAST load timeout in milliseconds for a single wrapper. This parameter is optional and will override the default timeout, currently set to 5000ms.