Amazon Vinyl
    Preparing search index...

    Function discoverHlsScte35AdBreaks

    • Discovers stitched (SSAI) ad breaks signalled by SCTE-35 in HLS EXT-X-DATERANGE tags and maps them to AdBreakInfo.

      Per RFC 8216 4.3.2.7.1, a splice out is a date range carrying SCTE35-OUT and the matching splice in is a later date range with the same ID carrying SCTE35-IN (and usually the now-known DURATION or END-DATE). A SCTE35-CMD carries any other command; it opens an avail when it is a time_signal with an advertising segmentation descriptor. The date ranges sharing an ID are merged into one break.

      The break's duration is taken from DURATION, the END-DATE span, PLANNED-DURATION, then the SCTE-35 break or segmentation duration. Within the break, each discontinuity starts a new ad, as stitched ads are usually separated by EXT-X-DISCONTINUITY.

      Wall-clock dates are mapped to the media timeline by the closest preceding EXT-X-PROGRAM-DATE-TIME, which stitched playlists repeat after each discontinuity. Breaks are skipped when the playlist has no program date time.

      Parameters

      • playlist: HlsMediaPlaylist

        The parsed HLS media playlist.

      • OptionalcontentDuration: number | null

        The total duration in seconds, if known, used to classify post-rolls.

      Returns AdBreakList