This class contains SDK-wide settings.
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 the current companion backfill mode.
Returns | |
---|---|
CompanionBackfillMode
|
The current value. |
getDisableCustomPlaybackForIOS10Plus
getDisableCustomPlaybackForIOS10Plus(): boolean
Returns whether to disable custom playback on iOS 10+ browsers. The default value is
false.
Returns | |
---|---|
boolean
|
Whether to disable custom playback. |
getFeatureFlags
getFeatureFlags(): Record<string, unknown>
Returns an object with keys as feature flags and values as their current state.
Returns | |
---|---|
Record<string, unknown>
|
The feature flags. |
getLocale
getLocale(): string
Returns the publisher provided locale.
Returns | |
---|---|
string
|
Publisher provided locale. |
getNumRedirects
getNumRedirects(): number
Returns the maximum number of redirects for subsequent redirects will be denied.
Returns | |
---|---|
number
|
the maximum number of redirects. |
getPlayerType
getPlayerType(): string
Returns the partner provided player type.
Returns | |
---|---|
string
|
Partner player type. |
getPlayerVersion
getPlayerVersion(): string
Returns the partner provided player version.
Returns | |
---|---|
string
|
Partner player version. |
getPpid
getPpid(): string
Returns the publisher provided id.
Returns | |
---|---|
string
|
The publisher provided id. |
setAutoPlayAdBreaks
setAutoPlayAdBreaks(autoPlayAdBreaks: boolean): void
Sets whether VMAP and ad rules ad breaks are automatically played
Parameters | |
---|---|
autoPlayAdBreaks: boolean
|
Whether to autoPlay the ad breaks. |
setCompanionBackfill
setCompanionBackfill(mode: CompanionBackfillMode): void
Sets the companion backfill mode. See the various modes available in
ImaSdkSettings.CompanionBackfillMode.
The default mode is ImaSdkSettings.CompanionBackfillMode.ALWAYS.
Parameters | |
---|---|
mode:
CompanionBackfillMode
|
The chosen companion backfill mode. |
setDisableCustomPlaybackForIOS10Plus
setDisableCustomPlaybackForIOS10Plus(disable: boolean): void
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.
Parameters | |
---|---|
disable: boolean
|
Whether or not to disable custom playback. |
setFeatureFlags
setFeatureFlags(featureFlags: Record<string, unknown>): void
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.
Parameters | |
---|---|
featureFlags: Record<string, unknown>
|
The feature flags object. |
setLocale
setLocale(locale: string): void
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.
Parameters | |
---|---|
locale: string
|
Publisher-provided locale. |
setNumRedirects
setNumRedirects(numRedirects: number): void
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.
Parameters | |
---|---|
numRedirects: number
|
The maximum number of redirects. |
setPlayerType
setPlayerType(playerType: string): void
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:
Example:
settings.setPlayerType('google/gmf-player');
Parameters | |
---|---|
playerType: string
|
The type of the partner player. |
setPlayerVersion
setPlayerVersion(playerVersion: string): void
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:
Example:
settings.setPlayerVersion('1.0.0');
Parameters | |
---|---|
playerVersion: string
|
The version of the partner player. |
setPpid
setPpid(ppid: string): void
Sets the publisher provided id.
Parameters | |
---|---|
ppid: string
|
publisher provided id. |
setSessionId
setSessionId(sessionId: string): void
Session ID is a temporary random ID. It is used exclusively for frequency capping. A
session ID must be a UUID.
Parameters | |
---|---|
sessionId: string
|
A temporary UUID used for frequency capping. |
setVpaidAllowed
setVpaidAllowed(allowVpaid: boolean): void
Sets whether VPAID creatives are allowed.
Parameters | |
---|---|
allowVpaid: boolean
|
Whether to allow VPAID creatives. |