Server-guided ad insertion (SGAI)¶
With server-guided ad insertion (SGAI), the manifest tells the player where ad breaks are and where to fetch the ads. The player then plays each ad as its own presentation and returns to the primary content afterward.
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 assetX-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.
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-URIin HLSA list MPD (
type="list") that references one or more ad MPDs, similar toX-ASSET-LISTin 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
CUEnotation.