StorytellerImaModule

class StorytellerImaModule : StorytellerModule, StorytellerImaModuleCapability

Optional Google IMA module for one true pre-roll before the initially opened Clip.

Register this module in Storyteller.modules alongside either the Legacy Ads module or the NextGen Ads module. A correctly configured module automatically enables IMA on supported phone and tablet initial root Clips sessions, including full-screen and Embedded openings; there is no presentation-level enablement flag. Following, Clips search, and category routes never request or play IMA.

The module only resolves a redacted, Storyteller-owned request descriptor. The SDK owns the Media3 loader, player attachment, lifecycle, analytics, and content handoff. IMA mid-roll, repeated cadence, banners, Stories, and Android TV are not supported. While IMA owns playback, content navigation remains blocked for both skippable and non-skippable creatives and resumes only after IMA hands playback to Clip content.

Types

Link copied to clipboard
object Companion

Factory for keyed or shared StorytellerImaModule instances.

Properties

Link copied to clipboard
open override val googleAdSource: StorytellerGoogleAdSource? = null

IMA is independent of the mutually exclusive GAM and AdMob standard-ad products.

Link copied to clipboard

Whether one supported configuration method has completed successfully.

Functions

Link copied to clipboard
open fun getAd(adContext: AdContext, slot: AdSlot, adRequestInfo: StorytellerAdRequestInfo, onComplete: (StorytellerAd) -> Unit, onAdFallbackRequest: (StorytellerAdLoadError) -> Unit, onError: (StorytellerAdLoadError) -> Unit)

open override fun getAd(adContext: AdContext, adRequestInfo: StorytellerAdRequestInfo, onComplete: (StorytellerAd) -> Unit, onAdFallbackRequest: (StorytellerAdLoadError) -> Unit, onError: (StorytellerAdLoadError) -> Unit)

IMA is not an ad-as-Clip module. Current SDKs exclude it from the standard request chain.

Link copied to clipboard
open override fun getBottomBannerAd(adContext: AdContext, adRequestInfo: StorytellerAdRequestInfo, onComplete: (StorytellerAd) -> Unit, onError: (StorytellerAdLoadError) -> Unit)

Bottom banners are not part of the IMA first-Clip module.

Link copied to clipboard
fun initWithAdTagUrl(adTagUrl: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> String, vastLoadTimeoutMs: Int? = null, mediaLoadTimeoutMs: Int? = null)

Configures IMA with a per-request complete HTTPS ad-tag callback.

fun initWithAdTagUrl(adTagUrl: String, vastLoadTimeoutMs: Int? = null, mediaLoadTimeoutMs: Int? = null)

Configures IMA with one complete HTTPS ad-tag URL.

Link copied to clipboard
fun initWithGam(adUnit: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> String, descriptionUrl: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> String, contentUrl: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> String? = { null }, customParams: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> Map<String, String> = { emptyMap() }, tagParameters: (StorytellerAdRequestInfo.ClipsAdRequestInfo) -> Map<String, String> = { emptyMap() }, vastLoadTimeoutMs: Int? = null, mediaLoadTimeoutMs: Int? = null)

Configures IMA using callbacks from which Storyteller builds a Google Ad Manager video tag.

Link copied to clipboard
open override fun onUserActivityOccurred(type: StorytellerUserActivity.EventType, data: UserActivityData)

IMA lifecycle analytics are emitted by the SDK player integration.