Amazon Vinyl
    Preparing search index...

    Class AdControllerImpl

    Provider-agnostic AdController. Holds the discovered ad breaks and derives enter/exit region events from playhead time updates.

    This controller is the model for ad playback: it knows which breaks exist, which break contains the playhead, and which ad within that break is current. It does NOT create, preload, or activate any tracks — that is the responsibility of the TrackController.

    A break is considered active while startTime <= currentTime < endTime, where endTime is startTime + duration. Breaks whose duration is unknown (null) or breaks which restrict jump will become active at currentTime > startTime

    This class contains no HLS- or DASH-specific logic; discovery code maps its protocol's signals to AdBreakInfo exposed by an AdsProvider.getAds, which this controller reads once the provider is set via AdController.setAdsProvider (and re-reads on adsChange).

    Hierarchy (View Summary)

    Implements

    Index
    logPrefix: string = ...

    A string prefix for all log statements made by this target.

    • Dispatches an event.

      Type Parameters

      Parameters

      • type: K

        The key of the event within EventMap

      • event: AdEventMap[K]

        If the passed event is read-only, then it may be re-used/cached. Otherwise, it should be a new event object every dispatch. If no target property is set on the event, the target will be set to this host.

      Returns void

    • Skips the current ad with 'error' for the completed reason. Emits an 'adError' event. If there are more ads in the break, the next ad begins. If it's the last ad, the break ends.

      No-op when no ad break is active.

      Parameters

      • error: Error

      Returns void

    • Skips the currently playing ad. If there are more ads in the break, the next ad begins. If it's the last ad, the break ends. No-op when no ad break is active.

      Returns void