ads library
广告入口:广告编排、广告模型、配置及广告覆盖层。 播放器与通用播放类型由 mova.dart 提供。
Classes
- IMovaAdFailPolicy
- Decides how to recover from an ad that would not play.
- IMovaAdWaitPolicy
- Decides whether a given ad break should be warmed up and cut to only once it is actually ready to play.
- MovaAdAbandonPod
- Abandons the entire pod on the first failure and goes straight to content.
- MovaAdBreak
- One ad break: the ad media plus when and how it plays.
- MovaAdEvent
- An ad lifecycle notification: what happened, and to which break.
- MovaAdFail
- One ad failure, fed to a IMovaAdFailPolicy.
- MovaAdOpts
- Options for pre/mid/post-roll ads.
- MovaAdOverlayComponent
- Overlay shown while an ad plays: an "ad" badge, a skip control that appears once the ad passes its skippable threshold, and a full-surface tap that reports a click-through (the host, not the library, opens any URL). Renders nothing when ads are disabled or no ad is currently playing.
- MovaAdRetrySkip
- Retries up to maxRetries times, then skips the break and carries on.
- MovaAds
- Orchestrates pre/mid/post-roll ads on top of a IMovaApi by swapping the playing source between the content and each ad break.
- MovaAdWaitByKind
- Answers "wait for readiness?" per MovaAdBreakKind, defaulting to the one rule that follows from what is on screen during the wait.
Enums
- MovaAdBreakKind
- Where an ad break is inserted relative to the content.
- MovaAdEventType
- Lifecycle events reported to MovaAdOpts.onAdEvent as an ad plays.
- MovaAdFailAction
- What the ad orchestration should do about a failed ad break.
- MovaAdFailKind
- Why an ad break failed to play.
- MovaAdNotReady
- What to do when an ad was supposed to be warmed up before cutting in, but was not ready in time.
- MovaAdSnapback
-
一次前跳越过多个中插点时的补播策略;示例:
MovaAdSnapback.last。 单个到期插入点(含同点 pod)仍正常播放。
Functions
-
dueMidRoll(
List< MovaAdBreak> breaks, Duration position, Set<MovaAdBreak> played) → MovaAdBreak? -
Returns the first not-yet-played mid-roll break whose MovaAdBreak.offset has
been reached at
position; null when none is due.