Insert dynamic ad breaks into an HLS stream using Apple HLS Interstitials
domain: developer.apple.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Add an EXT-X-DATERANGE tag to the primary playlist with CLASS set to com.apple.hls.interstitial.
Set the START-DATE attribute to the point in the primary content where the interstitial should play.
Reference interstitial content with X-ASSET-URI for a single asset, or X-ASSET-LIST pointing to a JSON document listing multiple assets with URI and DURATION.
Use supported X- attributes to control resume behavior and seek-snap points around the interstitial.
Test playback in a client with HLS Interstitials support (e.g., a recent AVPlayer-based app) to confirm the interstitial is fetched and inserted at the scheduled time.
Known gotchas
Only players built on interstitial-aware APIs handle the tag; older HLS players silently ignore the EXT-X-DATERANGE rather than erroring.
X-ASSET-LIST enables late-binding ad decisioning but adds an extra network round trip before the interstitial can start.
CLASS must be exactly com.apple.hls.interstitial (case-sensitive) or the tag is treated as a generic date range, not an interstitial.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?