Package com.castlabs.sdk.ima
Class ImaStreamRequest
java.lang.Object
com.castlabs.sdk.ima.ImaStreamRequest
IMA request implementation allowing to issue IMA stream requests with server side
ads insertion
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 ImaStreamRequest("ContentSourceId", "VideoId", "ApiKey").toAdRequest())
// Starting playback with PlayerConfig
PlayerConfig config = new PlayerConfig.Builder("content_url")
.adRequest(new ImaStreamRequest("ContentSourceId", "VideoId", "ApiKey").toAdRequest())
.contentType(SdkConsts.CONTENT_TYPE_DASH)
.get();
- Since:
- 4.2.19
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
Set totrue
to force play the closest skipped ad when seeking the content.final String
API key for the ad serverfinal String
Asset key for server side ad insertion streams.final String
Content source ID for VOD server side ad insertion streams.boolean
final String
Fallback Url to be used when stream Url can not be retrieved from the ad serverfinal String
Video ID for VOD server side ad insertion streams. -
Constructor Summary
ConstructorDescriptionImaStreamRequest
(String assetKey, String apiKey) Create IMA stream request for live streamsImaStreamRequest
(String contentSourceId, String videoId, String apiKey) Create IMA stream request for VOD streamsImaStreamRequest
(String assetKey, String apiKey, String fallbackUrl, boolean adSnapback) Create IMA stream request for live streamsImaStreamRequest
(String contentSourceId, String videoId, String apiKey, String fallbackUrl, boolean adSnapback) Create IMA stream request for VOD streamsImaStreamRequest
(String contentSourceId, String videoId, String apiKey, String assetKey, String fallbackUrl, boolean isLive, boolean adSnapback, boolean disableDefaultAdUi) -
Method Summary
-
Field Details
-
contentSourceId
Content source ID for VOD server side ad insertion streams. Set tonull
for live streams -
videoId
Video ID for VOD server side ad insertion streams. Set tonull
for live streams -
apiKey
API key for the ad server -
assetKey
Asset key for server side ad insertion streams. Set tonull
for VOD streams -
fallbackUrl
Fallback Url to be used when stream Url can not be retrieved from the ad server -
adSnapback
public final boolean adSnapbackSet totrue
to force play the closest skipped ad when seeking the content. -
disableDefaultAdUi
public boolean disableDefaultAdUi
-
-
Constructor Details
-
ImaStreamRequest
public ImaStreamRequest(@Nullable String contentSourceId, @Nullable String videoId, @Nullable String apiKey) Create IMA stream request for VOD streams- Parameters:
contentSourceId
- Content source IdvideoId
- Video IdapiKey
- API key
-
ImaStreamRequest
public ImaStreamRequest(@Nullable String contentSourceId, @Nullable String videoId, @Nullable String apiKey, @Nullable String fallbackUrl, boolean adSnapback) Create IMA stream request for VOD streams- Parameters:
contentSourceId
- Content source IdvideoId
- Video IdapiKey
- API keyfallbackUrl
- Fallback UrladSnapback
- Enable or disable ads snap back
-
ImaStreamRequest
Create IMA stream request for live streams- Parameters:
assetKey
- Asset keyapiKey
- API key
-
ImaStreamRequest
public ImaStreamRequest(@Nullable String assetKey, @Nullable String apiKey, @Nullable String fallbackUrl, boolean adSnapback) Create IMA stream request for live streams- Parameters:
assetKey
- Asset keyapiKey
- API keyfallbackUrl
- Fallback UrladSnapback
- Enable or disable ads snap back
-
ImaStreamRequest
-
-
Method Details