ImaServerSideAdInsertionUriBuilder


@UnstableApi
class ImaServerSideAdInsertionUriBuilder


Builder for URI for IMA DAI streams. The resulting URI can be used to build a media item that can be played by the .

Summary

Constants

const Int

The default timeout for loading the video URI, in milliseconds.

Public constructors

Creates a new instance.

Public functions

Uri!

Builds a URI with the builder's current values.

ImaServerSideAdInsertionUriBuilder!

Sets the overridable ad tag parameters on the stream request.

ImaServerSideAdInsertionUriBuilder!

An opaque identifier for associated ad playback state, or null if the asset key (for live) or video id (for VOD) should be used as the ads identifier.

ImaServerSideAdInsertionUriBuilder!

The stream request API key.

ImaServerSideAdInsertionUriBuilder!

The stream request asset key used for live streams.

ImaServerSideAdInsertionUriBuilder!

Sets the stream request authorization token.

ImaServerSideAdInsertionUriBuilder!

The stream request content source ID used for on-demand streams.

ImaServerSideAdInsertionUriBuilder!

Specifies the deep link to the content's screen.

ImaServerSideAdInsertionUriBuilder!

Sets the format of the stream request.

ImaServerSideAdInsertionUriBuilder!

Sets the duration after which resolving the video URI should time out, in milliseconds.

ImaServerSideAdInsertionUriBuilder!

Sets the optional stream manifest's suffix, which will be appended to the stream manifest's URL.

ImaServerSideAdInsertionUriBuilder!

Sets the ID to be used to debug the stream with the stream activity monitor.

ImaServerSideAdInsertionUriBuilder!

The stream request video ID used for on-demand streams.

Public properties

Int

Constants

DEFAULT_LOAD_VIDEO_TIMEOUT_MS

const val DEFAULT_LOAD_VIDEO_TIMEOUT_MS = 10000: Int

The default timeout for loading the video URI, in milliseconds.

Public constructors

ImaServerSideAdInsertionUriBuilder

ImaServerSideAdInsertionUriBuilder()

Creates a new instance.

Public functions

build

fun build(): Uri!

Builds a URI with the builder's current values.

Returns
Uri!

The build Uri.

Throws
java.lang.IllegalStateException

If the builder has missing or invalid inputs.

setAdTagParameters

@CanIgnoreReturnValue
fun setAdTagParameters(adTagParameters: (Mutable)Map<String!, String!>!): ImaServerSideAdInsertionUriBuilder!

Sets the overridable ad tag parameters on the stream request. Supply targeting parameters to your stream provides more information.

You can use the dai-ot and dai-ov parameters for stream variant preference. See Override Stream Variant Parameters for more information.

Parameters
adTagParameters: (Mutable)Map<String!, String!>!

A map of extra parameters to pass to the ad server.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setAdsId

@CanIgnoreReturnValue
fun setAdsId(adsId: String!): ImaServerSideAdInsertionUriBuilder!

An opaque identifier for associated ad playback state, or null if the asset key (for live) or video id (for VOD) should be used as the ads identifier.

Parameters
adsId: String!

The ads identifier.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setApiKey

@CanIgnoreReturnValue
fun setApiKey(apiKey: String?): ImaServerSideAdInsertionUriBuilder!

The stream request API key. This is used for content authentication. The API key is provided to the publisher to unlock their content. It's a security measure used to verify the applications that are attempting to access the content.

Parameters
apiKey: String?

Stream api key.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setAssetKey

@CanIgnoreReturnValue
fun setAssetKey(assetKey: String?): ImaServerSideAdInsertionUriBuilder!

The stream request asset key used for live streams.

Parameters
assetKey: String?

Live stream asset key.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setAuthToken

@CanIgnoreReturnValue
fun setAuthToken(authToken: String?): ImaServerSideAdInsertionUriBuilder!

Sets the stream request authorization token. Used in place of the API key for stricter content authorization. The publisher can control individual content streams authorizations based on this token.

Parameters
authToken: String?

Live stream authorization token.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setContentSourceId

@CanIgnoreReturnValue
fun setContentSourceId(contentSourceId: String?): ImaServerSideAdInsertionUriBuilder!

The stream request content source ID used for on-demand streams.

Parameters
contentSourceId: String?

VOD stream content source id.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setContentUrl

@CanIgnoreReturnValue
fun setContentUrl(contentUrl: String?): ImaServerSideAdInsertionUriBuilder!

Specifies the deep link to the content's screen. If provided, this parameter is passed to the OM SDK. See Android documentation for more information.

Parameters
contentUrl: String?

Deep link to the content's screen.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setFormat

@CanIgnoreReturnValue
fun setFormat(@C.ContentType format: Int): ImaServerSideAdInsertionUriBuilder!

Sets the format of the stream request.

Parameters
@C.ContentType format: Int

TYPE_DASH or TYPE_HLS.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setLoadVideoTimeoutMs

@CanIgnoreReturnValue
fun setLoadVideoTimeoutMs(loadVideoTimeoutMs: Int): ImaServerSideAdInsertionUriBuilder!

Sets the duration after which resolving the video URI should time out, in milliseconds.

The default is DEFAULT_LOAD_VIDEO_TIMEOUT_MS milliseconds.

Parameters
loadVideoTimeoutMs: Int

The timeout after which to give up resolving the video URI.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setManifestSuffix

@CanIgnoreReturnValue
fun setManifestSuffix(manifestSuffix: String?): ImaServerSideAdInsertionUriBuilder!

Sets the optional stream manifest's suffix, which will be appended to the stream manifest's URL. The provided string must be URL-encoded and must not include a leading question mark.

Parameters
manifestSuffix: String?

Stream manifest's suffix.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setStreamActivityMonitorId

@CanIgnoreReturnValue
fun setStreamActivityMonitorId(streamActivityMonitorId: String?): ImaServerSideAdInsertionUriBuilder!

Sets the ID to be used to debug the stream with the stream activity monitor. This is used to provide a convenient way to allow publishers to find a stream log in the stream activity monitor tool.

Parameters
streamActivityMonitorId: String?

ID for debugging the stream with the stream activity monitor.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

setVideoId

@CanIgnoreReturnValue
fun setVideoId(videoId: String?): ImaServerSideAdInsertionUriBuilder!

The stream request video ID used for on-demand streams.

Parameters
videoId: String?

VOD stream video id.

Returns
ImaServerSideAdInsertionUriBuilder!

This instance, for convenience.

Public properties

format

@C.ContentType
val formatInt