Delivering ad interstitials in podcast streams
Insert ad interstitials into HTTP Live Streaming (HLS) media playlists.
Overview
An HLS interstitial is alternate content, such as an advertisement, that the player inserts into a stream at a specific point without altering the primary media. Use the #EXT-X-DATERANGE tag in your HLS media playlists to deliver client-side interstitial advertising. Place an exact segment boundary at each interstitial cue point in your encoded media when possible. Use X-SNAP to let the player correct splice timing automatically. Include CUE=POST when you deliver a post-roll interstitial.
Use the following attributes with #EXT-X-DATERANGE for interstitial delivery:
# | Attribute | Description | Required | Example Value |
|---|---|---|---|---|
1 |
| Identifies the DATERANGE as an interstitial. Must be set to | Required |
|
2 |
| A timestamp indicating the exact point in time, relative to the | Required |
|
3 |
| A float value representing the intended (but not-to-exceed) duration of the interstitial. | See Note below. |
|
4 |
| A float value representing the known, exact duration of the interstitial. If both | See Note below. |
|
5 |
| Instructs the player to snap the interstitial splice point to the nearest segment boundary in the primary content. Accepts | Recommended |
|
6 |
| Specifies the offset time from the primary media. For interstitials, this is typically set to 0. | Required for Podcasts |
|
7 |
| Indicates how the interstitial is displayed within the episode timeline. For seamless integration, set to | Required for Podcasts |
|
8 |
| Defines the style of the interstitial’s timeline representation. For primary media, set to | Required for Podcasts |
|
Interstitial media can be delivered using one of two methods:
Reference the interstitial directly with the asset URI
Use X-ASSET-URI when you know the interstitial media playlist and it’s available when you create the HLS playlist. This attribute points directly to the interstitial’s HLS media playlist.
#EXT-X-DATERANGE:ID="ad_break_1",CLASS="com.apple.hls.interstitial",START-DATE="2023-10-27T10:00:00Z",PLANNED-DURATION=30.0,X-ASSET-URI="https://ad-server.example.com/ads/midroll1.m3u8",X-RESUME-OFFSET=0,X-TIMELINE-OCCUPIES="RANGE",X-TIMELINE-STYLE="PRIMARY"Resolve interstitials at playback
Use X-ASSET-LIST when you need flexibility to determine the interstitial media at playback or download time, or when no interstitial may be available. This attribute points to a JSON response that contains the interstitial media playlist information.
#EXT-X-DATERANGE:ID="ad_break_1",CLASS="com.apple.hls.interstitial",START-DATE="2023-10-27T10:00:00Z",PLANNED-DURATION=30.0,X-ASSET-LIST="https://ad-server.example.com/ads/midroll1.json",X-RESUME-OFFSET=0,X-TIMELINE-OCCUPIES="RANGE",X-TIMELINE-STYLE="PRIMARY"The JSON response specified by X-ASSET-LIST must contain an ASSETS array. Each object in the array represents an interstitial asset and includes the following keys:
URIThe URL of the interstitial’s HLS media playlist.
DURATIONA float value indicating the exact duration of the interstitial in seconds.
{
"ASSETS": [
{
"URI": "https://example.com/ads/interstitial_1.m3u8",
"DURATION": 15.0
}
]
}When you have no ad to place, use an empty list. The player skips the ad break and continues playing the main media.
{
"ASSETS": []
}