AdsRequest

public interface AdsRequest

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

Public Method Summary

abstract String
getAdTagUrl()
Returns the URL from which ads will be requested.
abstract String
getAdsResponse()
Returns the canned ads response.
abstract ContentProgressProvider
getContentProgressProvider()
Returns the progress provider that will be used to schedule ad breaks.
abstract String
getExtraParameter(String key)
Returns an extra parameter set by the setExtraParamaters method.
abstract Map<String, String>
getExtraParameters()
Returns a map of all extra parameters that have been set.
abstract Object
getUserRequestContext()
Returns the user-provided object that is associated with the ads request.
abstract void
setAdTagUrl(String adTagUrl)
Sets the URL from which ads will be requested.
abstract void
setAdWillAutoPlay(boolean willAutoPlay)
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.
abstract void
setAdWillPlayMuted(boolean willPlayMuted)
Notifies the SDK whether the player intends to start the content and ad while muted.
abstract void
setAdsResponse(String cannedAdResponse)
Specifies a VAST, VMAP, or ad rules response to be used instead of making a request via an ad tag URL.
abstract void
setContentDuration(float duration)
Specifies the duration of the content in seconds to be shown.
abstract void
setContentKeywords(List<String> keywords)
Specifies the keywords used to describe the content to be shown.
abstract void
setContentProgressProvider(ContentProgressProvider contentProgressProvider)
Attaches a ContentProgressProvider instance to allow scheduling ad breaks based on content progress (cue points).
abstract void
setContentTitle(String title)
Specifies the title of the content to be shown.
abstract void
setContinuousPlayback(boolean continuousPlayback)
Notifies the SDK whether the player intends to continuously play the content videos one after another similar to TV broadcast.
abstract void
setExtraParameter(String key, String value)
Sets an extra parameter to be used by the SDK.
abstract void
setLiveStreamPrefetchSeconds(float prefetchTime)
Specifies the maximum amount of time to wait in seconds, after calling requestAds, before requesting the ad tag URL.
abstract void
setUserRequestContext(Object userRequestContext)
Sets the user-provided object that is associated with the ads request.
abstract void
setVastLoadTimeout(float timeout)
Specifies the VAST load timeout in milliseconds for a single wrapper.

Public Methods

public abstract String getAdTagUrl ()

Returns the URL from which ads will be requested.

public abstract String getAdsResponse ()

Returns the canned ads response.

public abstract ContentProgressProvider getContentProgressProvider ()

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

public abstract String getExtraParameter (String key)

Returns an extra parameter set by the setExtraParamaters method.

Parameters
key

public abstract Map<String, String> getExtraParameters ()

Returns a map of all extra parameters that have been set.

public abstract Object getUserRequestContext ()

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

public abstract void setAdTagUrl (String adTagUrl)

Sets the URL from which ads will be requested. For details on constructing the ad tag url, see Create a master video tag manually. This parameter is required.

Parameters
adTagUrl

public abstract void setAdWillAutoPlay (boolean willAutoPlay)

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 Set to true if the ad will be autoplayed by the player, or false if playback is triggered by a user response.

public abstract void setAdWillPlayMuted (boolean willPlayMuted)

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 Set to true if the ad will be played while muted, or false if the ad will have volume greater than 0.

public abstract void setAdsResponse (String cannedAdResponse)

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

Parameters
cannedAdResponse

public abstract void setContentDuration (float duration)

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.

Parameters
duration

public abstract void setContentKeywords (List<String> keywords)

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.

Parameters
keywords

public abstract void setContentProgressProvider (ContentProgressProvider contentProgressProvider)

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

Parameters
contentProgressProvider

public abstract void setContentTitle (String title)

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.

Parameters
title

public abstract void setContinuousPlayback (boolean continuousPlayback)

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 Set to true if the content video is played one after another continuously.

public abstract void setExtraParameter (String key, String value)

Sets an extra parameter to be used by the SDK. This is only used for extra features within the SDK and is reserved for future use. This parameter is optional.

Parameters
key
value

public abstract void setLiveStreamPrefetchSeconds (float prefetchTime)

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.

Parameters
prefetchTime

public abstract void setUserRequestContext (Object userRequestContext)

Sets the user-provided object that is associated with the ads request. If supplied here, it will be available once the ad load is complete or fails. This object can be used to identify the request that caused an error or which request loaded a particular ads manager.

Parameters
userRequestContext

public abstract void setVastLoadTimeout (float timeout)

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.

Parameters
timeout