ReadonlycurrentThe ad currently playing within the active break, or null.
ReadonlycurrentThe ad break currently containing the playhead, or null when the playhead is in primary content.
ReadonlycurrentThe ad breaks known for the current media.
Activates the next postroll ad. Does nothing if there is no postroll. Resolves with the active postroll, or null if there wasn't one.
Activates the preroll ads. Does nothing if there is no preroll. Resolves with the active preroll, or null if there wasn't one.
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.
Returns true if the event host has any listeners.
Returns true if the event host has any listeners for the given type.
Adds an event handler for the given typed event.
The key representing the event type to listen for.
A callback to invoke when the event with the given type is dispatched.
Optionaloptions: SignalOptions
Options for changing listening behavior.
Returns a method, when invoked, removes the handler.
Sets the source of ad breaks, or null when no source is active. A
ReadonlyTrack satisfies AdsProvider directly, so the current
playing track can be passed as-is.
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.
Skips the entire active ad break, advancing past all remaining ads. No-op when no ad break is active.
Tracks the ad breaks for the current media and reports when the playhead enters and exits them.
The controller is deliberately agnostic of HLS/DASH discovery details: its input is a list of AdBreakInfo sourced from an AdsProvider (set via setAdsProvider); it derives the active break from the playhead by observing the playback controller.