Amazon Vinyl
    Preparing search index...

    Function discoverHlsInterstitials

    • Discovers HLS Interstitial ad breaks from a parsed media playlist and maps them to the provider-agnostic AdBreakInfo model.

      HLS Interstitials (Apple's SGAI primitive) are carried as EXT-X-DATERANGE tags with CLASS="com.apple.hls.interstitial". Each such range is anchored to a wall-clock START-DATE; this function converts that to a media-timeline start time by correlating it with the playlist's EXT-X-PROGRAM-DATE-TIME anchor. When the playlist carries no program date-time, and the range's start-date is not otherwise resolvable, the break is anchored to the start of the timeline (pre-roll) as a best effort.

      Parameters

      • playlist: HlsMediaPlaylist

        The parsed HLS media playlist.

      • baseUrl: string

        The URL of the media playlist, used to resolve relative X-ASSET-URI values.

      • OptionalcontentDuration: number | null

        The total content duration in seconds, if known, used to classify post-rolls. Pass null/undefined for live or unknown durations.

      Returns Promise<AdBreakList>