Package com.castlabs.sdk.ima
Class ImaAdRequest.Builder
java.lang.Object
com.castlabs.sdk.ima.ImaAdRequest.Builder
- Enclosing class:
ImaAdRequest
Builder for
ImaAdRequest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadPreloadTimeoutMs
(long adPreloadTimeoutMs) Sets the ad preload timeout in milliseconds.disableDefaultAdUi
(boolean disableDefaultAdUi) Sets whether to disable the default ad UI rendered by IMA.get()
Builds an instance ofImaAdRequest
.maxMediaBitrate
(int maxMediaBitrate) Sets the max media bitrate.mediaLoadTimeoutMs
(int mediaLoadTimeoutMs) Sets the ad media load timeout in milliseconds.playAdBeforeStartPosition
(boolean playAdBeforeStartPosition) Sets whether to play an ad before the start position.playAdsAfterTimeSec
(double seconds) Sets the play-ads-after content time in seconds for client-side IMA.scheduleDelayMs
(long scheduleDelayMs) Sets the time offset that will be added to the current position when manually scheduling ads.stallAdTimeoutMs
(int stallAdTimeoutMs) Sets the timeout in milliseconds to consider the ad playback stalled.Sets the ad tag URL.vastLoadTimeoutMs
(int vastLoadTimeoutMs) Sets the VAST load timeout in milliseconds.
-
Constructor Details
-
Builder
public Builder()Creates a new Builder forImaAdRequest
.
-
-
Method Details
-
tagUrl
Sets the ad tag URL.- Parameters:
tagUrl
- Ad tag Url- Returns:
- the Builder
-
stallAdTimeoutMs
Sets the timeout in milliseconds to consider the ad playback stalled.- Parameters:
stallAdTimeoutMs
- Timeout in ms to consider the ad playback stalled and switch to the main content playback- Returns:
- the Builder
-
scheduleDelayMs
Sets the time offset that will be added to the current position when manually scheduling ads.- Parameters:
scheduleDelayMs
- Time offset that will be added to the current position when manually scheduling ads. Note that this delay is just to allow for a smooth transition to the ad, not to schedule ads in advance.The IMA SDK will drop pending ads if they're not played in the seconds following the ad response itself, so the value will be limited to
ImaAdRequest.SCHEDULE_DELAY_MAXIMUM_MS
.Default is
ImaAdRequest.SCHEDULE_DELAY_DEFAULT_MS
.- Returns:
- the Builder
-
playAdsAfterTimeSec
Sets the play-ads-after content time in seconds for client-side IMA. When set, ads scheduled strictly at or before this content time will be skipped.- Parameters:
seconds
- Time in seconds (>= 0)- Returns:
- the Builder
-
disableDefaultAdUi
Sets whether to disable the default ad UI rendered by IMA.- Parameters:
disableDefaultAdUi
- Flag to Disable the default AD UI rendered by IMAThe IMA SDK UI will be disabled and the Application is free to provide it's custom AD UI. This flag will have no effect if the VAST Ad response doesnt have the following
1 tag set.Default is
ImaAdRequest.DISABLE_IMA_AD_UI
.- Returns:
- the Builder
-
adPreloadTimeoutMs
Sets the ad preload timeout in milliseconds.- Parameters:
adPreloadTimeoutMs
- The ad preload timeout in milliseconds. Must be greater than 0 orC.TIME_UNSET
.- Returns:
- the Builder
-
vastLoadTimeoutMs
Sets the VAST load timeout in milliseconds.- Parameters:
vastLoadTimeoutMs
- The VAST load timeout in milliseconds. Must be greater than 0.- Returns:
- the Builder
-
mediaLoadTimeoutMs
Sets the ad media load timeout in milliseconds.- Parameters:
mediaLoadTimeoutMs
- The ad media load timeout in milliseconds. Must be greater than 0.- Returns:
- the Builder
-
maxMediaBitrate
Sets the max media bitrate.- Parameters:
maxMediaBitrate
- The max media bitrate. Must be greater than 0.- Returns:
- the Builder
-
playAdBeforeStartPosition
Sets whether to play an ad before the start position.- Parameters:
playAdBeforeStartPosition
- Whether to play an ad before the start position. The default setting istrue
.- Returns:
- the Builder
-
get
Builds an instance ofImaAdRequest
.- Returns:
- an instance of
ImaAdRequest
-