Skip to content

@videts/vide


@videts/vide / vast / playWaterfall

Function: playWaterfall()

playWaterfall(player, ads, options): Promise<SingleAdResult | null>

Defined in: vast/pod.ts:150

Try ads in waterfall order. Play the first one that loads successfully. Returns the result of the first successful ad, or null if all fail.

Parameters

ParameterTypeDescription
playerPluginPlayer-
adsPlayableAd[]-
options{ adPlugins?: (ad) => AdPlugin[]; onFinish?: (result) => void; source: "vast" | "vmap"; }-
options.adPlugins?(ad) => AdPlugin[]-
options.onFinish?(result) => voidCalled synchronously when the winning ad finishes (or last failure).
options.source"vast" | "vmap"-

Returns

Promise<SingleAdResult | null>