ImaSdkSettings

interface ImaSdkSettings


Defines general SDK settings that are used when creating an AdsLoader.

An ImaSdkSettings object should not be modified after an AdsLoader is constructed; however, it can be reused to construct new AdsLoader instances.

See createAdsLoader and createAdsLoader.

Summary

Constants

const Int

The default maximum number of VAST redirects allowed.

Public functions

Boolean

Returns whether VMAP and ad rules ad breaks are automatically played.

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

Returns the feature flags and their states as set by the setFeatureFlags function.

String!

Gets the current ISO 639-1 language code.

Int

Returns the maximum number of VAST redirects.

String?

Returns the partner provided player type.

String?

Returns the partner provided player version.

String?

Returns the publisher provided ID (PPID) used for tracking.

String?

Returns the session ID if set.

Boolean

Returns whether debug mode is enabled.

Unit
setAutoPlayAdBreaks(autoPlayAdBreaks: Boolean)

Sets whether to automatically play VMAP and ad rules ad breaks.

Unit
setDebugMode(debugMode: Boolean)

Enables or disables debug mode.

Unit
setFeatureFlags(featureFlags: (Mutable)Map<String!, String!>!)

Sets the feature flags and their states to control experimental features.

Unit
setLanguage(language: String!)

Sets the preferred language for the ad UI.

Unit
setMaxRedirects(maxRedirects: Int)

Specifies the maximum number of redirects before the subsequent redirects are denied and the ad load aborted.

Unit
setPlayerType(playerType: String!)

Sets the partner provided player type.

Unit
setPlayerVersion(playerVersion: String!)

Sets the partner provided player version.

Unit
setPpid(ppid: String!)

Sets the publisher provided ID used for tracking.

Unit
setSessionId(sessionId: String!)

Sets a temporary session ID used for frequency capping.

String!

Returns a string representation of this ImaSdkSettings.

Constants

DEFAULT_MAX_REDIRECTS

const val DEFAULT_MAX_REDIRECTS = 4: Int

The default maximum number of VAST redirects allowed.

Public functions

getAutoPlayAdBreaks

fun getAutoPlayAdBreaks(): Boolean

Returns whether VMAP and ad rules ad breaks are automatically played.

Default is true.

getFeatureFlags

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

Returns the feature flags and their states as set by the setFeatureFlags function.

getLanguage

fun getLanguage(): String!

Gets the current ISO 639-1 language code. Defaults to "en" for English.

getMaxRedirects

fun getMaxRedirects(): Int

Returns the maximum number of VAST redirects.

Also see setMaxRedirects.

getPlayerType

fun getPlayerType(): String?

Returns the partner provided player type.

Returns
String?

{String} Partner player type.

getPlayerVersion

fun getPlayerVersion(): String?

Returns the partner provided player version.

Returns
String?

{String} Partner player version.

getPpid

fun getPpid(): String?

Returns the publisher provided ID (PPID) used for tracking.

getSessionId

fun getSessionId(): String?

Returns the session ID if set.

Returns
String?

{String} The session ID.

isDebugMode

fun isDebugMode(): Boolean

Returns whether debug mode is enabled.

Default is false.

setAutoPlayAdBreaks

fun setAutoPlayAdBreaks(autoPlayAdBreaks: Boolean): Unit

Sets whether to automatically play VMAP and ad rules ad breaks.

Parameters
autoPlayAdBreaks: Boolean

whether to automatically play ad breaks

setDebugMode

fun setDebugMode(debugMode: Boolean): Unit

Enables or disables debug mode. Debug mode is disabled by default.

Parameters
debugMode: Boolean

whether to enable debug mode

setFeatureFlags

fun setFeatureFlags(featureFlags: (Mutable)Map<String!, String!>!): Unit

Sets the feature flags and their states to control experimental features.

This should be set as early as possible, before requesting ads. Settings remain constant until the next ad request. Calling this method again resets any feature flags for the next ad request.

setLanguage

fun setLanguage(language: String!): Unit

Sets the preferred language for the ad UI.

You can find the supported codes in Localization and are closely related to the two-letter ISO 639-1 language codes. If invalid or unsupported, the language defaults to "en" for English. After you create the AdsLoader object, using this setter has no effect.

Parameters
language: String!

the language code to set.

setMaxRedirects

fun setMaxRedirects(maxRedirects: Int): Unit

Specifies the maximum number of redirects before the subsequent redirects are denied and the ad load aborted.

In this case, the ad raises an error with error code 302. The number of redirects directly affects latency and thus user experience. This applies to all VAST wrapper ads. The default is DEFAULT_MAX_REDIRECTS.

Parameters
maxRedirects: Int

the maximum number of redirects to allow.

setPlayerType

fun setPlayerType(playerType: String!): Unit

Sets the partner provided player type.

Specifies the name of the player integrated with the SDK to improve analytics. Provide a short, unique identifier. The IMA SDK truncates player type strings longer than 20 characters.

Example:

settings.setPlayerType("google/gmf-player");
Parameters
playerType: String!

{String} The type of the partner player.

setPlayerVersion

fun setPlayerVersion(playerVersion: String!): Unit

Sets the partner provided player version.

Specifies the version of the partner player integrated with the SDK. Tracks player version usage to improve SDK usability and analytics. The IMA SDK truncates player version strings longer than 20 characters

Example:

settings.setPlayerVersion("1.0.0");
Parameters
playerVersion: String!

{String} The version of the partner player.

setPpid

fun setPpid(ppid: String!): Unit

Sets the publisher provided ID used for tracking.

Parameters
ppid: String!

the ppid to set.

setSessionId

fun setSessionId(sessionId: String!): Unit

Sets a temporary session ID used for frequency capping. The session ID must be a UUID, or an empty string if the SDK should not send a session ID.

Parameters
sessionId: String!

a temporary UUID used for frequency capping

toString

fun toString(): String!

Returns a string representation of this ImaSdkSettings.