AdsRenderingSettings

public interface AdsRenderingSettings


Defines parameters that control the rendering of ads.

Summary

Public methods

abstract int
abstract boolean

Returns whether the click-through URL will be opened using Custom Tabs feature.

abstract boolean
abstract boolean

Whether to focus on the skip button when the skippable ad can be skipped on Android TV.

abstract List<String>
abstract void
setBitrateKbps(int bitrate)

Maximum recommended bitrate.

abstract void
setEnableCustomTabs(boolean enableCustomTabs)

Notifies the SDK whether to launch the click-through URL using Custom Tabs feature.

abstract void
setEnablePreloading(boolean enablePreloading)

If set, the SDK will instruct the player to load the creative in response to init.

abstract void
setFocusSkipButtonWhenAvailable(boolean enableFocusSkipButton)

Set whether to focus on the skip button when the skippable ad can be skipped on Android TV.

abstract void
setLoadVideoTimeout(int loadVideoTimeout)

Specifies a non-default amount of time to wait for media to load before timing out, in milliseconds.

abstract void
setMimeTypes(List<String> mimeTypes)

If specified, the SDK will prioritize the media with MIME type on the list.

abstract void
setPlayAdsAfterTime(double time)

For VMAP and ad rules playlists, only play ad breaks scheduled after this time (in seconds).

abstract void

Sets the ad UI elements to be rendered by the IMA SDK.

Public methods

getBitrateKbps

abstract int getBitrateKbps()

getEnableCustomTabs

abstract boolean getEnableCustomTabs()

Returns whether the click-through URL will be opened using Custom Tabs feature.

getEnablePreloading

abstract boolean getEnablePreloading()

getFocusSkipButtonWhenAvailable

abstract boolean getFocusSkipButtonWhenAvailable()

Whether to focus on the skip button when the skippable ad can be skipped on Android TV. This is a no-op on non-Android TV devices.

getMimeTypes

abstract List<StringgetMimeTypes()

setBitrateKbps

abstract void setBitrateKbps(int bitrate)

Maximum recommended bitrate. The value is in kbit/s. SDK will select media which has a bitrate below the specified max or the closest bitrate if there is no media with a lower bitrate found. Default value, -1, means the bitrate will be selected by the SDK.

Parameters
int bitrate

Maximum bitrate in kbit/s. Default is -1 for SDK to auto select.

setEnableCustomTabs

abstract void setEnableCustomTabs(boolean enableCustomTabs)

Notifies the SDK whether to launch the click-through URL using Custom Tabs feature.

Parameters
boolean enableCustomTabs

Set to true if the SDK needs to open the video or companion click-through URL using Custom Tabs feature. Default is false.

setEnablePreloading

abstract void setEnablePreloading(boolean enablePreloading)

If set, the SDK will instruct the player to load the creative in response to init. This allows the player to preload the ad at any point before calling start.

Parameters
boolean enablePreloading

Set to true if the SDK needs to preload the ad. Default is false.

setFocusSkipButtonWhenAvailable

abstract void setFocusSkipButtonWhenAvailable(boolean enableFocusSkipButton)

Set whether to focus on the skip button when the skippable ad can be skipped on Android TV. This is a no-op on non-Android TV devices.

Parameters
boolean enableFocusSkipButton

Set to false if the SDK need not auto focus on the skip button. Default is true.

setLoadVideoTimeout

abstract void setLoadVideoTimeout(int loadVideoTimeout)

Specifies a non-default amount of time to wait for media to load before timing out, in milliseconds. This only applies to the IMA client-side SDK. Default time is 8000 ms.

Parameters
int loadVideoTimeout

Time in milliseconds to wait for media load.

setMimeTypes

abstract void setMimeTypes(List<String> mimeTypes)

If specified, the SDK will prioritize the media with MIME type on the list. If not specified, the SDK will pick the media based on player capabilities. This only refers to the mime types of videos to be selected for linear ads.

Parameters
List<String> mimeTypes

MIME types to be prioritized during media selection.

setPlayAdsAfterTime

abstract void setPlayAdsAfterTime(double time)

For VMAP and ad rules playlists, only play ad breaks scheduled after this time (in seconds). This setting is strictly after - for example, setting playAdsAfterTime to 15 will ignore an ad break scheduled to play at 15s.

Parameters
double time

Time in seconds after which the eligible ad breaks will be played.

setUiElements

abstract void setUiElements(Set<UiElement> uiElements)

Sets the ad UI elements to be rendered by the IMA SDK. All values in the list are instances of UiElement. Some elements may be required to be displayed, or unable to be displayed for a given ad (for instance, the ad UI may be customizable for DFP direct sold ads, but not for AdSense ads). In these cases, some modifications to the uiElements list may have no effect for specific ads. As a result, you should always check getUiElements after setting uiElements.

For example, the SDK will attempt to render only the ad attribution with the following code: renderingSettings.setUiElements(ImmutableSet.of(UiElements.AD_ATTRIBUTION));

Parameters
Set<UiElement> uiElements

Ad UI elements to be rendered by the SDK.