Package com.castlabs.sdk.ima
Class ImaAdRequest
java.lang.Object
com.castlabs.sdk.ima.ImaAdRequest
IMA request implementation allowing to issue IMA Ad requests.
After
ImaPlugin is registered and enabled the request can be issued as following:
// Starting playback with a Bundle
Bundle bundle = new Bundle();
bundle.putParcelable(SdkConsts.INTENT_ADVERTS_DATA, new ImaAdRequest("ima_url").toAdRequest())
// Starting playback with PlayerConfig
PlayerConfig config = new PlayerConfig.Builder("content_url")
.adRequest(new ImaAdRequest("url").toAdRequest())
.get();
- Since:
- 3.2.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal longThe ad preload timeout in milliseconds.static final DoubleOptional play-ads-after content time in seconds.static final intDefault timeout to consider the ad playback stalled and switch to the main content playbackstatic final booleanDisable Default IMA UIfinal booleanFlag to disable the default ad UI rendered by IMA.final intThe max media bitrate.final intThe ad media load timeout in milliseconds.final booleanWhether to play an ad before the start position.final DoubleOptional play-ads-after content time in seconds.static final longDefault time offset that will be added to the current position when manually scheduling adsstatic final longMaximum value forscheduleDelayMsfinal longTime offset that will be added to the current position when manually scheduling ads.final intTimeout in ms to consider the ad playback stalled and switch to the main content playbackfinal StringAd tag Urlfinal intThe VAST load timeout in milliseconds. -
Constructor Summary
ConstructorsConstructorDescriptionImaAdRequest(String tagUrl) Deprecated.ImaAdRequest(String tagUrl, int stallAdTimeoutMs) Deprecated.UseImaAdRequest.Builderinstead. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()Converts thisImaAdRequestto anAdRequest.
-
Field Details
-
DEFAULT_STALL_AD_TIMEOUT_MS
public static final int DEFAULT_STALL_AD_TIMEOUT_MSDefault timeout to consider the ad playback stalled and switch to the main content playback- See Also:
-
SCHEDULE_DELAY_DEFAULT_MS
public static final long SCHEDULE_DELAY_DEFAULT_MSDefault time offset that will be added to the current position when manually scheduling ads- See Also:
-
DEFAULT_PLAY_ADS_AFTER_TIME_SEC
Optional play-ads-after content time in seconds. Default isnullwhich means all ads will be played. -
DISABLE_IMA_AD_UI
public static final boolean DISABLE_IMA_AD_UIDisable Default IMA UI- See Also:
-
SCHEDULE_DELAY_MAXIMUM_MS
public static final long SCHEDULE_DELAY_MAXIMUM_MSMaximum value forscheduleDelayMs- See Also:
-
tagUrl
Ad tag Url -
stallAdTimeoutMs
public final int stallAdTimeoutMsTimeout in ms to consider the ad playback stalled and switch to the main content playback -
scheduleDelayMs
public final long scheduleDelayMsTime offset that will be added to the current position when manually scheduling ads. -
playAdsAfterTimeSec
Optional play-ads-after content time in seconds. -
disableDefaultAdUi
public final boolean disableDefaultAdUiFlag to disable the default ad UI rendered by IMA. -
adPreloadTimeoutMs
public final long adPreloadTimeoutMsThe ad preload timeout in milliseconds. -
vastLoadTimeoutMs
public final int vastLoadTimeoutMsThe VAST load timeout in milliseconds. -
mediaLoadTimeoutMs
public final int mediaLoadTimeoutMsThe ad media load timeout in milliseconds. -
maxMediaBitrate
public final int maxMediaBitrateThe max media bitrate. -
playAdBeforeStartPosition
public final boolean playAdBeforeStartPositionWhether to play an ad before the start position. The default setting istrue.
-
-
Constructor Details
-
ImaAdRequest
Deprecated.useImaAdRequest.Builderinstead.Create Ima Ad request with specified tag Url.- Parameters:
tagUrl- Ad tag Url
-
ImaAdRequest
Deprecated.UseImaAdRequest.Builderinstead.Create Ima Ad request with specified tag Url.- Parameters:
tagUrl- Ad tag UrlstallAdTimeoutMs- Set to non-zero value to enable workaround for stalled ad playbacks and switch to the main content playback after the specified timeout. Set to-1to disable the workaround
-
-
Method Details
ImaAdRequest.Builderinstead.