AI-generated Key Takeaways
-
The
google.ima.ImaSdkSettingsclass contains SDK-wide settings for the IMA SDK. -
This class provides methods to get and set various settings, including companion backfill mode, custom playback on iOS 10+, feature flags, locale, number of redirects, player type and version, publisher provided id, session id, and VPAID settings.
-
Some settings, such as
setLocale, must be called before creatingAdsLoaderorAdDisplayContainer. -
The
setVpaidAllowedmethod is deprecated in favor ofsetVpaidMode.
| Methods | |
|---|---|
get
|
Returns the current companion backfill mode. |
get
|
Returns whether to disable custom playback on iOS 10+ browsers. |
get
|
Returns an object with keys as feature flags and values as their current state.
|
get
|
Returns the publisher provided locale. |
get
|
Returns the maximum number of redirects for subsequent redirects will be denied.
|
get
|
Returns the partner provided player type. |
get
|
Returns the partner provided player version. |
get
|
Returns the publisher provided id. |
set
|
Sets whether VMAP and ad rules ad breaks are automatically played. |
set
|
Sets the companion backfill mode. |
set
|
Sets whether to disable custom playback on iOS 10+ browsers. |
set
|
Set the value for any feature flags. |
set
|
Sets the publisher provided locale. |
set
|
Specifies the maximum number of redirects before the subsequent redirects will be
denied, and the ad load aborted.
|
set
|
Sets the partner provided player type. |
set
|
Sets the partner provided player version. |
set
|
Sets the publisher provided id. |
set
|
Session ID is a temporary random ID. |
set
|
Deprecated. Sets whether VPAID creatives are allowed.
|
set
|
Sets VPAID playback mode. |
Methods
getCompanionBackfill
getCompanionBackfill(): CompanionBackfillMode
| Returns | |
|---|---|
CompanionBackfillMode
|
The current value. |
getDisableCustomPlaybackForIOS10Plus
getDisableCustomPlaybackForIOS10Plus(): boolean
| Returns | |
|---|---|
boolean
|
Whether to disable custom playback. |
getFeatureFlags
getFeatureFlags(): Record<string, unknown>
| Returns | |
|---|---|
Record<string, unknown>
|
The feature flags. |
getLocale
getLocale(): string
| Returns | |
|---|---|
string
|
Publisher provided locale. |
getNumRedirects
getNumRedirects(): number
| Returns | |
|---|---|
number
|
the maximum number of redirects. |
getPlayerType
getPlayerType(): string
| Returns | |
|---|---|
string
|
Partner player type. |
getPlayerVersion
getPlayerVersion(): string
| Returns | |
|---|---|
string
|
Partner player version. |
getPpid
getPpid(): string
| Returns | |
|---|---|
string
|
The publisher provided id. |
setAutoPlayAdBreaks
setAutoPlayAdBreaks(autoPlayAdBreaks: boolean): void
| Parameters | |
|---|---|
autoPlayAdBreaks: boolean
|
Whether to autoPlay the ad breaks. |
setCompanionBackfill
setCompanionBackfill(mode: CompanionBackfillMode): void
The default mode is ImaSdkSettings.CompanionBackfillMode.ALWAYS.
| Parameters | |
|---|---|
mode:
CompanionBackfillMode
|
The chosen companion backfill mode. |
setDisableCustomPlaybackForIOS10Plus
setDisableCustomPlaybackForIOS10Plus(disable: boolean): void
| Parameters | |
|---|---|
disable: boolean
|
Whether or not to disable custom playback. |
setFeatureFlags
setFeatureFlags(featureFlags: Record<string, unknown>): void
| Parameters | |
|---|---|
featureFlags: Record<string, unknown>
|
The feature flags object. |
setLocale
setLocale(locale: string): void
| Parameters | |
|---|---|
locale: string
|
Publisher-provided locale. |
setNumRedirects
setNumRedirects(numRedirects: number): void
| Parameters | |
|---|---|
numRedirects: number
|
The maximum number of redirects. |
setPlayerType
setPlayerType(playerType: string): void
Example:
settings.setPlayerType('google/gmf-player'); | Parameters | |
|---|---|
playerType: string
|
The type of the partner player. |
setPlayerVersion
setPlayerVersion(playerVersion: string): void
Example:
settings.setPlayerVersion('1.0.0'); | Parameters | |
|---|---|
playerVersion: string
|
The version of the partner player. |
setPpid
setPpid(ppid: string): void
| Parameters | |
|---|---|
ppid: string
|
publisher provided id. |
setSessionId
setSessionId(sessionId: string): void
| Parameters | |
|---|---|
sessionId: string
|
A temporary UUID used for frequency capping. |
setVpaidAllowed
setVpaidAllowed(allowVpaid: boolean): void
| Parameters | |
|---|---|
allowVpaid: boolean
|
Whether to allow VPAID creatives. |