StorytellerVastModule

@Singleton
class StorytellerVastModule : StorytellerModule

Storyteller VAST Module — generic IAB VAST support for compatible VAST 2.0, 3.0, 4.0, 4.1, and 4.2 linear video ads.

The module is protocol-focused and vendor-neutral. Host apps configure the HTTPS VAST endpoint, provide per-request parameters, and choose how parameters are serialised into the final tag URL. The SDK then fetches VAST XML, resolves wrappers, selects a playable media file, maps tracking URLs into Storyteller ad tracking, and returns a StorytellerAd through the standard module fallback chain.

Basic setup:

val vastModule = StorytellerVastModule.getInstance(applicationContext).apply {
init(
baseUrl = "https://example.com/vast",
requestParameters = { adRequestInfo -> mapOf("placementId" to "abc-123") },
urlFormat = UrlFormat.QueryString,
)
}
Storyteller.modules = listOf(vastModule)

See also

StorytellerModule

Types

Link copied to clipboard
object Companion

Factory for StorytellerVastModule instances.

Properties

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

VAST is not backed by Google Mobile Ads; attribution is carried as ad source vast.

Functions

Link copied to clipboard

Live stream of diagnostics events emitted by this module's pipeline.

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

Legacy SDK module entry point without slot context.

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

Loads a VAST-backed StorytellerAd for the supplied slot.

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

Bottom banner ads are not part of the VAST protocol surface. Always fails the request so the SDK fallback chain can try the next module.

Link copied to clipboard
fun init(baseUrl: String, requestParameters: (StorytellerAdRequestInfo) -> Map<String, String>, urlFormat: UrlFormat = UrlFormat.PathSegment)

Configures the VAST module. Must be called before the module is registered with com.storyteller.Storyteller.modules.

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

VAST modules do not consume SDK user-activity events.