google.ima. ImaSdkSettings
This class contains SDK-wide settings.
Constructor
ImaSdkSettings
new ImaSdkSettings()
Methods
getCompanionBackfill
getCompanionBackfill() returns CompanionBackfillMode
Returns the current companion backfill mode.
- Returns
-
non-null CompanionBackfillMode
The current value.
getDisableCustomPlaybackForIOS10Plus
getDisableCustomPlaybackForIOS10Plus() returns boolean
Gets whether to disable custom playback on iOS 10+ browsers. The default value is false.
- Returns
-
boolean
getFeatureFlags
getFeatureFlags() returns Object with unknown properties
Returns an object with keys as feature flags and values as their current state.
- Returns
-
non-null Object with unknown properties
getLocale
getLocale() returns string
Returns the publisher provided locale.
- Returns
-
string
Publisher provided locale.
getNumRedirects
getNumRedirects() returns number
Returns the maximum number of redirects for subsequent redirects will be denied.
- Returns
-
number
the maximum number of redirects.
getPlayerType
getPlayerType() returns string
Returns the partner provided player type.
- Returns
-
string
Partner player type.
getPlayerVersion
getPlayerVersion() returns string
Returns the partner provided player version.
- Returns
-
string
Partner player version.
getPpid
getPpid() returns string
Returns the publisher provided id.
- Returns
-
string
publisher provided id.
isCookiesEnabled
isCookiesEnabled() returns boolean
- Returns
-
boolean
Whether the publisher allows cookies to be used.
setAutoPlayAdBreaks
setAutoPlayAdBreaks(autoPlayAdBreaks)
Sets whether VMAP and ad rules ad breaks are automatically played
Parameter |
|
---|---|
autoPlayAdBreaks |
boolean Whether to autoPlay the ad breaks. |
setCompanionBackfill
setCompanionBackfill(mode)
Sets the companion backfill mode. Please see the various modes available in ImaSdkSettings.CompanionBackfillMode.
The default mode is ImaSdkSettings.CompanionBackfillMode.ALWAYS.
Parameter |
|
---|---|
mode |
CompanionBackfillMode The desired companion backfill mode. Value must not be null. |
setCookiesEnabled
setCookiesEnabled(cookiesEnabled)
Allows the publisher to opt-out of using the Google Ad Manager cookie (the gfp cookie). This will not affect other cookies the IMA SDK uses. Whether or not this is enabled, the SDK will respect user opt-outs via IAB compliant Consent Management Provider for GDPR if in the same frame. For more details please see this Ad Manager article on Integration with the IAB TCF v2.0
Parameter |
|
---|---|
cookiesEnabled |
boolean |
setDisableCustomPlaybackForIOS10Plus
setDisableCustomPlaybackForIOS10Plus(disable)
Sets whether to disable custom playback on iOS 10+ browsers. If true, ads will play inline if the content video is inline. This enables TrueView skippable ads. However, the ad will stay inline and not support iOS's native fullscreen. When false, ads will play in the same player as your content. The value set here when an AdDisplayContainer is created is used for the lifetime of the container. The default value is false.
Parameter |
|
---|---|
disable |
boolean Whether or not to disable custom playback. |
setFeatureFlags
setFeatureFlags(featureFlags)
Set the value for any feature flags. 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.
Parameter |
|
---|---|
featureFlags |
Object with unknown properties Value must not be null. |
setLocale
setLocale(locale)
Sets the publisher provided locale. Must be called before creating AdsLoader or AdDisplayContainer. The locale specifies the language in which to display UI elements. The supported codes can be found in Localizing for Language and Locale.
Parameter |
|
---|---|
locale |
string Publisher-provided locale. |
setNumRedirects
setNumRedirects(numRedirects)
Specifies the maximum number of redirects before the subsequent redirects will be denied, and the ad load aborted. The number of redirects directly affects latency and thus user experience. This applies to all VAST wrapper ads.
Parameter |
|
---|---|
numRedirects |
number the maximum number of redirects. |
setPlayerType
setPlayerType(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');
Parameter |
|
---|---|
playerType |
string The type of the partner player. |
setPlayerVersion
setPlayerVersion(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');
Parameter |
|
---|---|
playerVersion |
string The version of the partner player. |
setPpid
setPpid(ppid)
Sets the publisher provided id.
Parameter |
|
---|---|
ppid |
string publisher provided id. |
setSessionId
setSessionId(sessionId)
Session ID is a temporary random ID. It is used exclusively for frequency capping. A session ID must be a UUID.
Parameter |
|
---|---|
sessionId |
string A temporary UUID used for frequency capping. |
setVpaidAllowed
setVpaidAllowed(allowVpaid)
Deprecated. Please use setVpaidMode. Sets whether VPAID creatives are allowed.
Parameter |
|
---|---|
allowVpaid |
boolean Whether to allow VPAID creatives. |
setVpaidMode
setVpaidMode(vpaidMode)
Sets VPAID playback mode.
Parameter |
|
---|---|
vpaidMode |
VpaidMode Sets how VPAID ads will be played. Default is secure mode. Value must not be null. |