MovaAdOpts class

Options for pre/mid/post-roll ads.

Disabled and empty by default so enabling it is an explicit host decision. The ads orchestrator (MovaAds) is host-constructed and orchestrates the content↔ad source swaps; this bundle only carries the schedule and the onAdEvent hook (the sole way click-through is surfaced — mova never opens a URL itself).

前/中/后贴片广告的配置。

默认关闭且列表为空,是否启用由宿主显式决定。广告编排对象(MovaAds)由宿主 构造并编排正片↔广告的源切换;本配置只承载排期与 onAdEvent 钩子(点击跳转的 唯一暴露途径——mova 从不自行打开 URL)。

Constructors

MovaAdOpts({bool enabled = false, MovaAdSnapback midRollSnapback = MovaAdSnapback.all, List<MovaAdBreak> breaks = const <MovaAdBreak>[], void onAdEvent(MovaAdEvent event)?, IMovaAdWaitPolicy waitForAdReady = const MovaAdWaitByKind(), Duration adReadyTimeout = const Duration(seconds: 5), MovaAdNotReady notReadyAction = MovaAdNotReady.hardCut, IMovaAdFailPolicy? failPolicy, Duration loadTimeout = const Duration(seconds: 8), bool durationFromFirstFrame = true, MovaWarmPlan? adWarmPlan})
Creates ad options; disabled and empty by default.
const

Properties

adReadyTimeout → Duration
Upper bound on how long an ad may be waited for before notReadyAction decides what to do instead.
final
adWarmPlan → MovaWarmPlan?
Injectable warm-up plan for the content→ad direction; null uses effectiveWarmPlan's default.
final
breaks → List<MovaAdBreak>
The ad breaks to schedule.
final
durationFromFirstFrame → bool
Whether MovaAdBreak.duration is counted from the ad's first rendered frame rather than from open().
final
effectiveFailPolicy → IMovaAdFailPolicy
The failure policy actually in effect.
no setter
effectiveWarmPlan → MovaWarmPlan
The warm-up plan used for the content→ad direction.
no setter
enabled → bool
Master switch; no ads play when false.
final
failPolicy → IMovaAdFailPolicy?
Injectable recovery rule for ads that will not play; null uses MovaAdRetrySkip.
final
hashCode → int
The hash code for this object.
no setteroverride
loadTimeout → Duration
How long after open() an ad with no first frame counts as failed.
final
midRollSnapback → MovaAdSnapback
返回多点前跳的补播策略,默认 all;示例:opts.midRollSnapback。
final
notReadyAction → MovaAdNotReady
What to do when the wait ran out; MovaAdNotReady.hardCut by default, because the fallback must be exactly today's behaviour.
final
onAdEvent → void Function(MovaAdEvent event)?
Host hook notified of every ad lifecycle event, including MovaAdEventType.clicked (which carries the click-through URL to act on).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
waitForAdReady → IMovaAdWaitPolicy
Whether an ad is warmed up and cut to only once ready; consulted only when MovaAdBreak.waitForReady leaves the question open.
final

Methods

copyWith({bool? enabled, MovaAdSnapback? midRollSnapback, List<MovaAdBreak>? breaks, void onAdEvent(MovaAdEvent event)?, IMovaAdWaitPolicy? waitForAdReady, Duration? adReadyTimeout, MovaAdNotReady? notReadyAction, IMovaAdFailPolicy? failPolicy, Duration? loadTimeout, bool? durationFromFirstFrame, MovaWarmPlan? adWarmPlan}) → MovaAdOpts
Returns a copy with the given fields replaced; omitted fields keep their current value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
waitsFor(MovaAdBreak adBreak) → bool
Resolves whether adBreak waits for readiness: the break's own MovaAdBreak.waitForReady wins when set, otherwise waitForAdReady decides.

Operators

operator ==(Object other) → bool
The equality operator.
override