Server-guided ad insertion (SGAI) ********************************* Server-guided ad insertion (SGAI): the manifest signals ad breaks, the player loads and plays ads as separate presentations. HLS uses interstitials, DASH uses alternative MPDs. HLS interstitials ================= In HTTP Live Streaming (HLS), SGAI is implemented with interstitials. An interstitial is an "EXT-X-DATERANGE" tag with "CLASS="com.apple.hls.interstitial"". It points to the ad in one of two ways: * "X-ASSET-URI": a single ad asset * "X-ASSET-LIST": an asset list, a JSON document with one or more ad assets The "CUE" attribute sets when the interstitial plays: as a pre-roll ("PRE"), as a post-roll ("POST"), or only once ("ONCE"). Other attributes are defined in the HLS specification (https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis). DASH alternative MPDs ===================== In Dynamic Adaptive Streaming over HTTP (DASH), SGAI is implemented with alternative Media Presentation Descriptions (MPDs). They're signaled with MPD events of two kinds: * Insert ("urn:mpeg:dash:event:alternativeMPD:insert:2025"): primary playback pauses, the alternative MPD plays, and primary playback resumes where it paused. * Replace ("urn:mpeg:dash:event:alternativeMPD:replace:2025"): the alternative MPD replaces part of the primary content. The event links to the alternative MPD, which is one of the following: * A classic MPD with a single ad, similar to "X-ASSET-URI" in HLS * A list MPD ("type="list"") that references one or more ad MPDs, similar to "X-ASSET-LIST" in HLS Alternative MPDs differ from HLS interstitials in several ways, including: * The player doesn't know in advance whether the link leads to a list MPD or a classic MPD. It finds out only after fetching the MPD. * DASH doesn't use the "CUE" notation. Platform implementation guides ============================== * PRESTOplay for Web Apps server-guided ad insertion