DASH Protocol Support
DASH-IF compliant MPD generation with multi-period ad insertion, EventStream signaling, and seamless period transitions for SSAI.
MPD Structure
DASH manifests (Media Presentation Descriptions) are XML documents that describe the available media streams. ApexMediation supports both single-period origin content and multi-period SSAI output.
Multi-Period MPD Structure
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
type="dynamic"
minimumUpdatePeriod="PT2S"
availabilityStartTime="YYYY-MM-DDTHH:MM:SSZ"
publishTime="YYYY-MM-DDTHH:MM:SSZ">
<UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-xsdate:2014"
value="https://time.apexmediation.ee/xsdate"/>
<!-- Content Period -->
<Period id="content-1" start="PT0S" duration="PT30M24S">
<AdaptationSet mimeType="video/mp4" contentType="video">
<Representation id="v1080" bandwidth="5000000" width="1920" height="1080">
<SegmentTemplate timescale="90000"
initialization="init-$RepresentationID$.m4s"
media="seg-$RepresentationID$-$Time$.m4s">
<SegmentTimeline>
<S t="0" d="540000" r="303"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
<!-- Ad Period -->
<Period id="ad-pod-1" start="PT30M24S" duration="PT30S">
<EventStream schemeIdUri="urn:apex:ssai:2025" timescale="1000">
<Event presentationTime="0" duration="30000" id="pod-1">
{"type":"ad-pod","slots":2}
</Event>
</EventStream>
<AdaptationSet mimeType="video/mp4" contentType="video">
<!-- Ad segments here -->
</AdaptationSet>
</Period>
<!-- Content Period (continued) -->
<Period id="content-2" start="PT30M54S">
<!-- Content continues -->
</Period>
</MPD>Period Types
Content Periods
- • Source from origin CMS
- • Stable segment templates
- • Long-cacheable segments
Ad Periods
- • Injected by SSAI service
- • Per-session segment URLs
- • EventStream metadata
Single-to-Multi-Period Conversion
Many origins provide single-period MPDs. The SSAI service converts these to multi-period on the fly, splitting at ad break boundaries.
Origin MPD (Single Period)
<MPD type="dynamic">
<Period id="main">
<!-- All content in one period -->
<EventStream>
<Event><!-- SCTE-35 marker --></Event>
</EventStream>
<AdaptationSet>
<!-- Segments -->
</AdaptationSet>
</Period>
</MPD>SSAI MPD (Multi Period)
<MPD type="dynamic">
<Period id="content-1">
<!-- Content before ad -->
</Period>
<Period id="ad-pod-1">
<!-- Inserted ad pod -->
</Period>
<Period id="content-2">
<!-- Content after ad -->
</Period>
</MPD>Conversion Process
- 1. Parse Events: Detect SCTE-35 or custom ad markers in origin EventStream
- 2. Split Timeline: Create new period boundaries at each ad marker
- 3. Inject Ads: Insert ad periods with decisioned creative segments
- 4. Adjust Timing: Update segment timelines and period start times
EventStream Signaling
DASH uses EventStream elements to signal in-band events. ApexMediation supports both origin-side and SSAI-side event streams.
Supported Scheme URIs
| Scheme URI | Purpose | Direction |
|---|---|---|
urn:scte:scte35:2014:xml+bin | SCTE-35 binary markers | Origin → SSAI |
urn:dvb:dash:cuepoint:2022 | DVB-DASH cue points | Origin → SSAI |
urn:apex:ssai:2025 | SSAI pod metadata | SSAI → Player |
SSAI Event Structure
<EventStream schemeIdUri="urn:apex:ssai:2025" timescale="1000">
<Event presentationTime="0" duration="30000" id="pod-abc123">
{
"type": "ad-pod",
"podId": "pod-abc123",
"breakType": "midroll",
"slots": [
{"slotId": "slot-1", "creativeId": "cr-xyz", "duration": 15000},
{"slotId": "slot-2", "creativeId": "cr-abc", "duration": 15000}
],
"trackingUrl": "https://track.apexmediation.ee/v1/pod/abc123"
}
</Event>
</EventStream>Live DASH Behavior
Live DASH streams require careful MPD update handling to ensure smooth playback across ad insertions.
UTCTiming Strategy
Stable UTCTiming elements ensure players sync correctly. We useurn:mpeg:dash:utc:http-xsdate:2014 with our time server.
Segment Timeline Evolution
Segment timelines evolve predictably. The minimumUpdatePeriod andtimeShiftBufferDepth are maintained consistently.
Period Continuity
Period IDs are stable across MPD updates. Periods are never removed or reordered within the availability window.
Avoided Issues
- Player "reset" at period transitions: Caused by inconsistent adaptation sets. Our ad periods match content encoding parameters.
- Timeline gaps: Caused by incorrect period durations. All period boundaries are precisely calculated.
- UTCTiming drift: Caused by unreliable time sources. Our time server has <10ms accuracy.
Player Compatibility
Different DASH players have varying levels of support for multi-period manifests and EventStream parsing.
| Player | Multi-Period | EventStream | CMAF | Live | Notes |
|---|---|---|---|---|---|
| Shaka Player | ✓ | ✓ | ✓ | ✓ | Best cross-platform support |
| dash.js | ✓ | ✓ | ✓ | ✓ | Reference implementation |
| ExoPlayer | ✓ | ✓ | ✓ | ✓ | Android, Fire TV |
| Bitmovin | ✓ | ✓ | ✓ | ✓ | Commercial player |
| Roku (native) | ✓ | △ | ✓ | ✓ | EventStream via RAF |
SDK Integration for Event Handling
// Web SDK - Shaka Player integration
import { SSAIManifestParser } from '@apexmediation/web-sdk';
// Shaka event listener
player.addEventListener('timelineregionenter', (event) => {
const region = event.region;
if (region.schemeIdUri === 'urn:apex:ssai:2025') {
const adPod = JSON.parse(region.eventNode.textContent);
console.log('Entering ad pod:', adPod.podId);
// SDK handles tracking automatically
}
});
player.addEventListener('timelineregionexit', (event) => {
console.log('Exiting region:', event.region.id);
});VOD-Specific Behavior
Static MPD Type
VOD manifests use type="static" with mediaPresentationDurationset to the total duration including all ad breaks.
Complete Period List
All periods (content and ads) are present in the initial manifest. No MPD updates are required during playback.
Seek Support
Players can seek across periods seamlessly. Period boundaries are correctly mapped to seek positions.
DASH vs HLS for SSAI
| Feature | DASH | HLS |
|---|---|---|
| Ad Break Structure | Separate periods | Inline with discontinuity |
| Metadata | EventStream elements | DATERANGE tags |
| Encoding Changes | Natural at period boundary | EXT-X-DISCONTINUITY required |
| Safari Support | Requires MSE polyfill | Native |
| Widevine/PlayReady | Full support | Limited (CMAF only) |