ImaSdkFactory

class ImaSdkFactory


Factory class for creating SDK objects.

Summary

Public functions

AdDisplayContainer!

This function is deprecated.

Use createAdDisplayContainer(ViewGroup container, VideoAdPlayer player) instead.

java-static AdDisplayContainer!

Creates an AdDisplayContainer to hold the player for video ads, a container for non-linear ads, and slots for companion ads.

AdsLoader!
createAdsLoader(
    context: Context!,
    settings: ImaSdkSettings!,
    container: AdDisplayContainer!
)

Creates an AdsLoader for requesting ads using the specified settings object.

AdsLoader!
createAdsLoader(
    context: Context!,
    settings: ImaSdkSettings!,
    container: StreamDisplayContainer!
)

Creates an AdsLoader for requesting server-side ad insertion ads using the specified settings object.

AdsRenderingSettings!

Creates an AdsRenderingSettings object to give the AdsManager parameters that control the rendering of ads.

AdsRequest!

Creates an AdsRequest object to contain the data used to request ads.

AdDisplayContainer!

This function is deprecated.

Use createAudioAdDisplayContainer(ViewGroup container, VideoAdPlayer player) instead.

java-static AdDisplayContainer!

Creates an AdDisplayContainer for audio ads.

CompanionAdSlot!

Creates a CompanionAdSlot for the SDK to fill with companion ads.

FriendlyObstruction!
createFriendlyObstruction(
    view: View!,
    purpose: FriendlyObstructionPurpose!,
    detailedReason: String?
)

Creates a FriendlyObstruction object to describe an obstruction considered "friendly" for viewability measurement purposes.

ImaSdkSettings!

Creates an ImaSdkSettings object for configuring the IMA SDK.

StreamRequest!
createLiveStreamRequest(assetKey: String!, apiKey: String?)

This function is deprecated.

Use createLiveStreamRequest(String assetKey, String apiKey, String networkCode) instead.

StreamRequest!
createLiveStreamRequest(
    assetKey: String!,
    apiKey: String?,
    networkCode: String?
)

Creates a StreamRequest object to contain the data used to request a server-side ad insertion live stream.

StreamRequest!
createPodStreamRequest(
    networkCode: String!,
    customAssetKey: String!,
    apiKey: String?
)

Creates a StreamRequest object to contain the data used to request a server-side ad insertion pod serving live stream.

StreamRequest!

Creates a StreamRequest object to contain the data used to request a 3rd party stitched server-side ad insertion pod serving vod stream.

StreamDisplayContainer!

This function is deprecated.

Use createStreamDisplayContainer(ViewGroup container, VideoStreamPlayer player) instead.

java-static StreamDisplayContainer!
createStreamDisplayContainer(
    container: ViewGroup!,
    player: VideoStreamPlayer!
)

Creates a StreamDisplayContainer to hold the player for server-side ad insertion streams and slots for companion ads.

StreamRequest!
createVideoStitcherLiveStreamRequest(
    networkCode: String!,
    customAssetKey: String!,
    liveStreamEventId: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!
)

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod live serving stream.

StreamRequest!
createVideoStitcherVodStreamRequest(
    networkCode: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!,
    vodConfigId: String!
)

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod serving vod stream, with a vod config flow.

StreamRequest!
createVideoStitcherVodStreamRequest(
    contentSourceUrl: String!,
    networkCode: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!,
    adTagUrl: String!
)

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod serving vod stream.

StreamRequest!
createVodStreamRequest(
    contentSourceId: String!,
    videoId: String!,
    apiKey: String?
)

This function is deprecated.

Use createVodStreamRequest(String contentSourceId, String videoId, String apiKey, String networkCode) instead.

StreamRequest!
createVodStreamRequest(
    contentSourceId: String!,
    videoId: String!,
    apiKey: String?,
    networkCode: String?
)

Creates a StreamRequest object to contain the data used to request a server-side ad insertion video on demand stream.

Unit
initialize(context: Context!, settings: ImaSdkSettings!)

Starts to preload SDK resources in advance.

Public properties

java-static ImaSdkFactory?

Public functions

createAdDisplayContainer

fun createAdDisplayContainer(): AdDisplayContainer!

Creates an AdDisplayContainer to hold the player for video ads, a container for non-linear ads, and slots for companion ads.

createAdDisplayContainer

java-static fun createAdDisplayContainer(container: ViewGroup!, player: VideoAdPlayer!): AdDisplayContainer!

Creates an AdDisplayContainer to hold the player for video ads, a container for non-linear ads, and slots for companion ads.

createAdsLoader

fun createAdsLoader(
    context: Context!,
    settings: ImaSdkSettings!,
    container: AdDisplayContainer!
): AdsLoader!

Creates an AdsLoader for requesting ads using the specified settings object. This is the only way to specify a non-default language for the Ad UI.

Parameters
context: Context!

Context for the an upcoming ad request. Required to use the activity context.

settings: ImaSdkSettings!

The settings for the SDK in an upcoming ad request. This parameter requires an ImaSdkSettings object.

container: AdDisplayContainer!

The container for IMA to render the ad UI.

createAdsLoader

fun createAdsLoader(
    context: Context!,
    settings: ImaSdkSettings!,
    container: StreamDisplayContainer!
): AdsLoader!

Creates an AdsLoader for requesting server-side ad insertion ads using the specified settings object. This is the only way to specify a non-default language for the Ad UI.

Parameters
context: Context!

Context for the an upcoming stream request. Required to use the activity context.

settings: ImaSdkSettings!

The settings for the SDK in an upcoming stream request. This parameter requires an ImaSdkSettings object.

container: StreamDisplayContainer!

The container for IMA to render the ad UI.

createAdsRenderingSettings

fun createAdsRenderingSettings(): AdsRenderingSettings!

Creates an AdsRenderingSettings object to give the AdsManager parameters that control the rendering of ads.

createAdsRequest

fun createAdsRequest(): AdsRequest!

Creates an AdsRequest object to contain the data used to request ads.

createAudioAdDisplayContainer

fun createAudioAdDisplayContainer(context: Context!): AdDisplayContainer!

Creates an AdDisplayContainer for audio ads. In order to properly handle companion ads this should be created in the same process as your main Activity.

createAudioAdDisplayContainer

java-static fun createAudioAdDisplayContainer(context: Context!, player: VideoAdPlayer!): AdDisplayContainer!

Creates an AdDisplayContainer for audio ads. In order to properly handle companion ads this should be created in the same process as your main Activity.

createCompanionAdSlot

fun createCompanionAdSlot(): CompanionAdSlot!

Creates a CompanionAdSlot for the SDK to fill with companion ads.

createFriendlyObstruction

fun createFriendlyObstruction(
    view: View!,
    purpose: FriendlyObstructionPurpose!,
    detailedReason: String?
): FriendlyObstruction!

Creates a FriendlyObstruction object to describe an obstruction considered "friendly" for viewability measurement purposes. If the detailedReason is not null, it must follow the IAB standard by being 50 characters or less and only containing characters A-z , 0-9, or spaces.

createImaSdkSettings

fun createImaSdkSettings(): ImaSdkSettings!

Creates an ImaSdkSettings object for configuring the IMA SDK.

createLiveStreamRequest

fun createLiveStreamRequest(assetKey: String!, apiKey: String?): StreamRequest!

Creates a StreamRequest object to contain the data used to request a server-side ad insertion live stream.

Parameters
assetKey: String!

Determines which stream you request. The live stream request asset key is an identifier that you can find in the Ad Manager UI. For more information, see Locate live linear stream URL and asset key.

createLiveStreamRequest

fun createLiveStreamRequest(
    assetKey: String!,
    apiKey: String?,
    networkCode: String?
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a server-side ad insertion live stream.

Parameters
assetKey: String!

Determines which stream you request. The live stream request asset key is an identifier which you can find in the Ad Manager UI.

apiKey: String?

Optional: The stream request API key. Set up the key in the Ad Manager Admin UI and use it in the application to unlock the content. The key verifies applications to access the content.

networkCode: String?

Optional: The network code for the Ad Manager account that owns the stream. The code is recommended because it is used to apply settings selected in the Ad Manager UI such as programmatic limited ads enablement. To find the network code, see Find Ad Manager account information .

createPodStreamRequest

fun createPodStreamRequest(
    networkCode: String!,
    customAssetKey: String!,
    apiKey: String?
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a server-side ad insertion pod serving live stream.

Parameters
networkCode: String!

The network code for the publisher making this stream request. Network codes are required for pod serving stream requests; with an invalid code the stream request will fail. The code is also used to apply settings selected in the Ad Manager UI such as programmatic limited ads enablement. To find the network code, see this article.

customAssetKey: String!

The custom asset key is used to determine which stream should be played. Custom asset keys are required for pod serving stream requests.

apiKey: String?

Optional: The stream request API key. Set up the key in the Ad Manager Admin UI and use it in the application to unlock the content. The key verifies applications to access the content.

createPodVodStreamRequest

fun createPodVodStreamRequest(networkCode: String!): StreamRequest!

Creates a StreamRequest object to contain the data used to request a 3rd party stitched server-side ad insertion pod serving vod stream.

createStreamDisplayContainer

fun createStreamDisplayContainer(): StreamDisplayContainer!

Creates a StreamDisplayContainer to hold the player for server-side ad insertion streams and slots for companion ads.

createStreamDisplayContainer

java-static fun createStreamDisplayContainer(
    container: ViewGroup!,
    player: VideoStreamPlayer!
): StreamDisplayContainer!

Creates a StreamDisplayContainer to hold the player for server-side ad insertion streams and slots for companion ads.

createVideoStitcherLiveStreamRequest

fun createVideoStitcherLiveStreamRequest(
    networkCode: String!,
    customAssetKey: String!,
    liveStreamEventId: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod live serving stream.

createVideoStitcherVodStreamRequest

fun createVideoStitcherVodStreamRequest(
    networkCode: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!,
    vodConfigId: String!
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod serving vod stream, with a vod config flow.

createVideoStitcherVodStreamRequest

fun createVideoStitcherVodStreamRequest(
    contentSourceUrl: String!,
    networkCode: String!,
    region: String!,
    projectNumber: String!,
    oAuthToken: String!,
    adTagUrl: String!
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a cloud video stitcher server-side ad insertion pod serving vod stream.

createVodStreamRequest

fun createVodStreamRequest(
    contentSourceId: String!,
    videoId: String!,
    apiKey: String?
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a server-side ad insertion video on demand stream.

createVodStreamRequest

fun createVodStreamRequest(
    contentSourceId: String!,
    videoId: String!,
    apiKey: String?,
    networkCode: String?
): StreamRequest!

Creates a StreamRequest object to contain the data used to request a server-side ad insertion video on demand stream.

Parameters
contentSourceId: String!

The content source ID for video on demand server-side ad insertion streams.

videoId: String!

The video ID for video on demand server-side ad insertion streams.

apiKey: String?

Optional: The stream request API key. Set up the key in the Ad Manager Admin UI and use it in the application to unlock the content. The key verifies applications to access the content.

networkCode: String?

Optional: The network code for the Ad Manager account that owns the stream. The code is recommended because it is used to apply settings selected in the Ad Manager UI such as programmatic limited ads enablement. To find the network code, see Find Ad Manager account information.

initialize

fun initialize(context: Context!, settings: ImaSdkSettings!): Unit

Starts to preload SDK resources in advance. Initialization only needs to be called once before the first adsloader is created. Initialization is optional but recommended, as it prepares components for each adsloader, improving the first ad/stream request response time.

Parameters
context: Context!

Context for the SDK. Recommend to use the application context.

settings: ImaSdkSettings!

The settings for the SDK in an upcoming ad request. This parameter requires an ImaSdkSettings object.

Public properties

instance

java-static val instanceImaSdkFactory?