Package com.castlabs.sdk.ima
Class ImaAdRequest
- java.lang.Object
-
- com.castlabs.sdk.ima.ImaAdRequest
-
public final class ImaAdRequest extends Object
IMA request implementation allowing to issue IMA Ad requests. AfterImaPluginis 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 Modifier and Type Class Description static classImaAdRequest.BuilderBuilder forImaAdRequest
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_STALL_AD_TIMEOUT_MSDefault timeout to consider the ad playback stalled and switch to the main content playbackstatic longSCHEDULE_DELAY_DEFAULT_MSDefault time offset that will be added to the current position when manually scheduling adsstatic longSCHEDULE_DELAY_MAXIMUM_MSMaximum value forscheduleDelayMslongscheduleDelayMsTime offset that will be added to the current position when manually scheduling ads.intstallAdTimeoutMsTimeout in ms to consider the ad playback stalled and switch to the main content playbackStringtagUrlAd tag Url
-
Constructor Summary
Constructors Constructor Description ImaAdRequest(String tagUrl)Create Ima Ad request with specified tag Url.ImaAdRequest(String tagUrl, int stallAdTimeoutMs)Deprecated.UseImaAdRequest.Builderinstead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()AdRequesttoAdRequest()
-
-
-
Field Detail
-
DEFAULT_STALL_AD_TIMEOUT_MS
public static final int DEFAULT_STALL_AD_TIMEOUT_MS
Default timeout to consider the ad playback stalled and switch to the main content playback- See Also:
- Constant Field Values
-
SCHEDULE_DELAY_DEFAULT_MS
public static final long SCHEDULE_DELAY_DEFAULT_MS
Default time offset that will be added to the current position when manually scheduling ads- See Also:
- Constant Field Values
-
SCHEDULE_DELAY_MAXIMUM_MS
public static final long SCHEDULE_DELAY_MAXIMUM_MS
Maximum value forscheduleDelayMs- See Also:
- Constant Field Values
-
tagUrl
@Nullable public final String tagUrl
Ad tag Url
-
stallAdTimeoutMs
public final int stallAdTimeoutMs
Timeout in ms to consider the ad playback stalled and switch to the main content playback
-
scheduleDelayMs
public final long scheduleDelayMs
Time offset that will be added to the current position when manually scheduling ads.
-
-
Constructor Detail
-
ImaAdRequest
public ImaAdRequest(@Nullable String tagUrl)Create Ima Ad request with specified tag Url.- Parameters:
tagUrl- Ad tag Url
-
ImaAdRequest
public ImaAdRequest(@Nullable String tagUrl, int stallAdTimeoutMs)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
-
-