import type { AdBreak, LinearAd } from '../advertising/API'; import type { PlaybackRestrictions } from '../core/PlayerAPI'; import type { HlsInterstitial } from './HlsInterstitialsConfigAPI'; import type { SgaiAdTrackerData } from './SgaiAdTrackerTypes'; export type SgaiAd = { /** * The unique identifier for the ad. */ id: string; /** * The scheduled start time for the ad in seconds. */ start: number; /** * The end time for the ad in seconds. */ end: number; }; export interface SgaiLinearAd extends LinearAd { /** * The ad creative signaling data associated with this ad. * This data is used for ad tracking and reporting purposes. * * Parsed based on SVTA spec */ adCreativeSignaling?: SgaiAdTrackerData; /** * Custom ad tracking information. */ customAdTrackingInfo?: any; } export interface SgaiAdBreak extends AdBreak { /** * The total duration the ad break is expected to play for. */ totalPlannedDuration?: number; /** * Playback restrictions to apply during ad playback (e.g., seeking, playback rate changes). */ restrictions?: PlaybackRestrictions; /** * The list of ads to be played during this ad break. * * Overrides the `ads` property type inherited from `AdBreak`. */ ads?: SgaiLinearAd[]; /** * Ad creative signaling data for the ad break. * Top level ad creative signaling present in ASSET-LIST applicable to the entire ad break. * For ASSET-URI, this value is present on DATE-RANGE level. * * Parsed based on SVTA spec */ adCreativeSignaling?: SgaiAdTrackerData; /** * Custom ad tracking information for the ad break. */ customAdTrackingInfo?: any; } export interface PlayerSgaiAPI { /** * Returns a list of all SGAI ads that are scheduled for playback. Does not include current active ad. */ list(): SgaiAd[] | HlsInterstitial[]; /** * Skips the currently playing ad. */ skip(): Promise; /** * Returns the currently active SGAI ad, if any. */ getActiveAd(): LinearAd | undefined; }