How it works
Every stream here is published as three HLS media playlists that share the same segments:
| Playlist | What it carries | Who acts on it |
|---|---|---|
clean.m3u8 | Content only. | Any player. |
ssai.m3u8 | Ad-break markers: SCTE-35 in EXT-X-DATERANGE (SCTE35-OUT/SCTE35-IN) and the de-facto EXT-X-CUE-OUT / CUE-OUT-CONT / CUE-IN tags. | A server-side ad stitcher. Players ignore the markers. |
sgai.m3u8 | HLS Interstitials: EXT-X-DATERANGE with CLASS="com.apple.hls.interstitial" and an X-ASSET-URI. | The player itself: Safari, AVPlayer and hls.js 1.6+ fetch and play the ad. |
The standards, briefly
- SCTE-35 is the cue message that says "an ad break starts here, for this long". It comes from broadcast, where it rides in the MPEG transport stream. In HLS it travels in a playlist tag.
- Signalling in HLS: the HLS spec (RFC 8216bis) defines
EXT-X-DATERANGEwithSCTE35-OUT,SCTE35-INandSCTE35-CMDattributes. Many stitchers also read the older de-factoEXT-X-CUE-OUT/CUE-INtags. Both are emitted here. - SSAI (server-side ad insertion; also called DAI, for dynamic ad insertion): a manipulator such as AWS MediaTailor reads those markers. It asks an ad server which ads to play, using the IAB's VAST and VMAP formats. It then rewrites the playlist per viewer so ad segments replace the break. The player just sees one stream.
- SGAI (server-guided ad insertion) uses HLS Interstitials, Apple's standard since 2021. The server only says where a break is and which asset (or asset list) to play. The player fetches and plays the ad, then returns to the content. Here the "ad" is a placeholder slate with a countdown.
- CSAI (client-side ad insertion, for example the Google IMA SDK) leaves everything to the player and needs no markers at all.
The breaks here
- VOD: a 15-second pre-roll, and a 30-second mid-roll at the segment boundary nearest the middle. In VOD the ad is inserted, so the film pauses and resumes where it stopped.
- Live: a 30-second break every 5 minutes, at 2:00 past (UTC wall clock). In live the break replaces content. On the test card the picture says AD BREAK while it runs. Interstitial players rejoin the live edge afterwards.
Credits
Player: hls.js (Apache-2.0, licence), served from this site.