ImaSdkSettings

public interface ImaSdkSettings

Defines general SDK settings that are used when creating an AdsLoader. ImaSdkSettings object should not be modified after AdsLoader is constructed; however it can be reused to construct new AdsLoader instances. ImaSdkFactory.createAdsLoader(android.content.Context, ImaSdkSettings, AdDisplayContainer) {@link ImaSdkFactory#createAdsLoader( android.content.Context, ImaSdkSettings, StreamDisplayContainer)

Constant Summary

int DEFAULT_MAX_REDIRECTS

Public Method Summary

abstract boolean
getAutoPlayAdBreaks()
Specifies whether VMAP and ad rules ad breaks are automatically played.
abstract Map<String, String>
getFeatureFlags()
Returns the feature flags and their states as set by the setFeatureFlags(Map) function.
abstract String
getLanguage()
Gets the current ISO 639-1 language code.
abstract int
getMaxRedirects()
Returns the maximum number of VAST redirects.
abstract String
getPlayerType()
Returns the partner provided player type.
abstract String
getPlayerVersion()
Returns the partner provided player version.
abstract String
abstract String
getSessionId()
Returns the session ID if set.
abstract boolean
isDebugMode()
Gets the debug mode.
abstract void
setAutoPlayAdBreaks(boolean autoPlayAdBreaks)
Sets whether to automatically play VMAP and ad rules ad breaks.
abstract void
setDebugMode(boolean debugMode)
Enables and disables the debug mode, which is disabled by default.
abstract void
setFeatureFlags(Map<String, String> featureFlags)
Sets the feature flags and their states to control experimental features.
abstract void
setLanguage(String language)
Sets the preferred language for the ad UI.
abstract void
setMaxRedirects(int maxRedirects)
Specifies the maximum number of redirects before the subsequent redirects will be denied and the ad load aborted.
abstract void
setPlayerType(String playerType)
Sets the partner provided player type.
abstract void
setPlayerVersion(String playerVersion)
Sets the partner provided player version.
abstract void
setPpid(String ppid)
Sets the publisher provided ID used for tracking.
abstract void
setSessionId(String sessionId)
Session ID is a temporary random ID.
abstract String
toString()
Returns a string representation of this ImaSdkSettings.

Constants

public static final int DEFAULT_MAX_REDIRECTS

Constant Value: 4

Public Methods

public abstract boolean getAutoPlayAdBreaks ()

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

Default is TRUE

public abstract Map<String, String> getFeatureFlags ()

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

public abstract String getLanguage ()

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

See Also
  • http://www.loc.gov/standards/iso639-2/php/English_list.php

public abstract int getMaxRedirects ()

Returns the maximum number of VAST redirects. Also see setMaxRedirects(int).

public abstract String getPlayerType ()

Returns the partner provided player type.

Returns
  • {String} Partner player type.

public abstract String getPlayerVersion ()

Returns the partner provided player version.

Returns
  • {String} Partner player version.

public abstract String getPpid ()

Returns
  • the ppid.

public abstract String getSessionId ()

Returns the session ID if set.

Returns
  • {String} The session ID.

public abstract boolean isDebugMode ()

Gets the debug mode.

Default is FALSE

public abstract void setAutoPlayAdBreaks (boolean autoPlayAdBreaks)

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

Parameters
autoPlayAdBreaks {boolean} Whether to autoPlay the ad breaks.

public abstract void setDebugMode (boolean debugMode)

Enables and disables the debug mode, which is disabled by default.

Parameters
debugMode Whether to enable debug mode or not.

public abstract void setFeatureFlags (Map<String, String> featureFlags)

Sets the feature flags and their states to control experimental features. This should be set as early as possible, before requesting ads. Settings will remain constant until the next ad request. Calling this method again will reset any feature flags for the next ad request.

Parameters
featureFlags

public abstract void setLanguage (String language)

Sets the preferred language for the ad UI. The supported codes can be found in the Localization guide and are closely related to the two-letter ISO 639-1 language codes. If invalid or unsupported, the language will default to "en" for English. Once the AdsLoader object has been created, using this setter will have no effect.

Parameters
language

public abstract void setMaxRedirects (int maxRedirects)

Specifies the maximum number of redirects before the subsequent redirects will be denied and the ad load aborted. In this case, the ad will raise 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 the maximum number of redirects to allow.

public abstract void setPlayerType (String playerType)

Sets the partner provided player type. This setting should be used to specify the name of the player being integrated with the SDK. Player type greater than 20 characters will be truncated. The player type specified should be short and unique. This is an optional setting used to improve SDK usability by tracking player types.

Example:

 
 settings.setPlayerType("google/gmf-player");
 

Parameters
playerType {String} The type of the partner player.

public abstract void setPlayerVersion (String playerVersion)

Sets the partner provided player version. This setting should be used to specify the version of the partner player being integrated with the SDK. Player versions greater than 20 characters will be truncated. This is an optional setting used to improve SDK usability by tracking player version.

Example:

 
 settings.setPlayerVersion("1.0.0");
 

Parameters
playerVersion {String} The version of the partner player.

public abstract void setPpid (String ppid)

Sets the publisher provided ID used for tracking.

Parameters
ppid the ppid to set.

public abstract void setSessionId (String sessionId)

Session ID is a temporary random ID. It is used exclusively for frequency capping. A 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.

public abstract String toString ()

Returns a string representation of this ImaSdkSettings.