Amazon Vinyl
    Preparing search index...

    Interface AdsProvider

    The minimal surface an AdController needs to source its ad breaks: a resolver for the current break list, plus an adsChange event to signal when that list changes. A ReadonlyTrack satisfies this directly, so the current playing track can be passed as-is; applications may also implement it to supply ads out of band (e.g. from an external ad server).

    interface AdsProvider {
        getAds(): Promise<TrackAds>;
        hasAnyListeners(): boolean;
        hasListeners(type: "adsChange"): boolean;
        on<K extends "adsChange">(
            type: K,
            handler: EventHandler<AdsProviderEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
    }

    Hierarchy (View Summary)

    Index
    • Resolves to the provider's current ad breaks. The result may change over the provider's lifetime; each adsChange event indicates that a subsequent call may return different breaks.

      Returns Promise<TrackAds>