Documentation

MPEG-DASH Streaming

MPEG-DASH support in Radiant Media Player

Radiant Media Player supports MPEG-DASH streaming with Shaka Player to HTML5 video & audio. Our implementation relies on media source extensions (MSE) and Managed Media Source for Apple devices (Safari 17+). Where Media Source Extensions or Managed Media Source support is not available (e.g. older iOS, Android), a HLS or progressive download fallback can be provided (use dashFirst set to true while providing a MPEG-DASH and HLS stream to the src setting).

Supported MPEG-DASH features

  • Multi-codec/multi-container manifests, we will negotiate support with the device directly, including ISO BMFF (CMAF / fMP4 with H.264, H.265 or AV1 video) and WebM (VP8, VP9 or AV1 video) content - even in the same manifest
  • Multi-codec variants (on platforms with changeType support)
  • Live, DVR and on-demand media content
  • Optimized adaptive bitrate streaming with automatic or manual bitrate selection
  • Multiple-audio tracks
  • All forms of segment index info: SegmentBase@indexRange, SegmentTimeline, SegmentTemplate@duration, SegmentTemplate@index, SegmentList
  • WebVTT, CEA-608/708 captions and TTML text tracks
  • DRM (PlayReady, Widevine, ClearKey) - including custom ContentProtection schemas, PSSH in the manifest
  • Multi-period content (static and dynamic)
  • Xlink elements (actuate=onLoad only, resolve-to-zero, fallback content)
  • Audio-only
  • MPD chaining
  • Resilience to errors
  • MPD Patch updates

Supported environments

See our compatibility table for a list of environments where MPEG-DASH streaming is supported with Radiant Media Player.

CORS requirements

You must set up your streaming server to return proper CORS settings permitting GET requests for MPEG-DASH streaming to Radiant Media Player to work as expected.

Player code example

MPEG-DASH stream with HLS fallback:

<!-- Include Radiant Media Player - here we use the optimised build for Shaka player -->
<script src="https://cdn.radiantmediatechs.com/rmp/10.1.1/js/rmp-shaka.min.js"></script>
<!-- Player container element -->
<div id="rmp"></div>
<!-- Set up player configuration options -->
<script>
  // Here we pass our MPEG-DASH streaming source
  const src = {
    dash: 'https://your-dash-url.mpd',
    // Optional, but needed to support iOS before iOS 17.1 and older Android
    // hls: 'https://your-hls-url.m3u8'
  };
  const settings = {
    licenseKey: 'your-license-key',
    src,
    width: 640,
    height: 360,
    // Here we tell the player to prioritise MPEG-DASH source
    dashFirst: true,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    }
  };
  const rmp = new RadiantMP('rmp');
  // Initialization ... and done!
  async function initRmpPlayer() {
    try {
      await rmp.init(settings);
    } catch(error) {
      console.error('Radiant Media Player failed to initialize', error);
    }
  }
  initRmpPlayer();
</script>

Player settings for MPEG-DASH streaming

General

capLevelToPlayerSize: Boolean

This setting limits bitrates usable in auto-quality depending on player size (width). Default: true. If set to true, potential rendition width will be compared with the actual player width and only the best match will be used as the maximum available bitrate, hence helping to preserve bandwidth usage while maintaining streaming quality. This setting is ignored in manual mode so all levels can be selected manually. For 360° video this setting is always set to false.

Why is that setting on by default in Radiant Media Player?

Reducing the streaming media industry carbon footprint matters! Also bandwidth can be expensive. Not only for you as a streaming service but also for your viewers. There is very little point to throw a 1080p rendition in a player that is 640x360 window-sized. This can actually result in a poor viewing experience as more resources will be used by the client device (CPU, memory, network). Therefore we have decided to set capLevelToPlayerSize default to true. This can still be turn off for specific needs.

dashFirst: Boolean

When used in conjonction with HLS this setting will tell the player to prioritise MPEG-DASH over HLS (prioritising HLS is the player default). You may want to set that setting to true, if you intend to provide an HLS fallback to your MPEG-DASH stream to support iOS before iOS 17.1 and some older Android devices. Default: false.

displayCodecData: Boolean

When set to true this setting will add codecs information to the quality menu for each rendition where that information is available. Default: false.

ignoreDevicePixelRatio: Boolean

When set to true this setting will not take into account devicePixelRatio for ABR logic. Default: true.

ignoreHardwareResolution: Boolean

Do not detect the hardware resolution. For some niche cases where content is only available at resolutions beyond the device's native resolution, and you are confident it can be decoded and downscaled, this flag can allow playback when it would otherwise fail. Default: false.

disableVideo: Boolean

If true, the video tracks are ignored. Default: false.

disableAudio: Boolean

If true, the audio tracks are ignored. Default: false.

disableIFrames: Boolean

If true, the HLS I-Frames tracks are ignored. Default: false.

disableThumbnails: Boolean

If true, the image tracks are ignored. Default: false.

shakaRestrictions: Object

An object describing application restrictions on what tracks can play. All restrictions must be fulfilled for a track to be playable. If a track does not meet the restrictions, it will not appear in the track list and it will not be played. More information can be found here. The setting is set as follows (replace number with the targeted value).

shakaRestrictions: {
  minWidth: number, // The minimum width of a video track, in pixels.
  maxWidth: number, // The maximum width of a video track, in pixels.
  minHeight: number, // The minimum height of a video track, in pixels.
  maxHeight: number, // The maximum height of a video track, in pixels.
  minPixels: number, // The minimum number of total pixels in a video track (i.e. width * height).
  maxPixels: number, // The maximum number of total pixels in a video track (i.e. width * height).
  minAudioBandwidth: number, // The minimum bandwidth of an audio track, in bit/sec.
  maxAudioBandwidth: number, // The maximum bandwidth of an audio track, in bit/sec.
  minVideoBandwidth: number, // The minimum bandwidth of a video track, in bit/sec.
  maxVideoBandwidth: number // The maximum bandwidth of a video track, in bit/sec.
}

shakaRequestConfiguration: Object

This object allows the player to fine tune the way it requests manifest, segment or DRM license data (Fetch requests). This setting can be used to make requests with credentials and allow cookies passing in cross-site requests. Example:

shakaRequestConfiguration: {
  manifest: {
    credentials: true
  },
  segment: {
    credentials: true
  },
  license: {
    credentials: true
  }
}

This setting is often used in conjunction with DRM-encrypted content. See our MPEG-DASH DRM documentation page for more advanced use-case.

Enabling credentials with shakaRequestConfiguration will also enable requests with credentials in our Google Cast CAF receiver.

manualSwitchingMode: String

Select what mode for manual bitrate switching should be used by the player. Available values are 'instant', 'smooth', 'conservative'. Default: 'smooth' which provides an intermediary setting between 'instant' (immediate) and 'conservative' (slow) bitrate switching.

shakaClearBufferSwitch: Boolean

If true, the buffer will be cleared during the switch in ABR mode. This allows for faster switch in resolution without having to wait for the current buffer to be emptied before presenting a new rendition to the viewer. Default: true.

shakaLiveSync: Boolean

Enable the live stream sync against the live edge by changing the player playback rate. Defaults to true.

Video, audio and subtitle preferences

videoPreference: Object

videoPreference.label: String

The preferred label to use for video tracks (based on manifest data).

videoPreference.videoHdr: String

The preferred HDR level of the video. If possible, this will cause the player to filter assets that either have that HDR level, or no HDR level at all. Can be 'SDR', 'PQ', 'HLG', 'auto' for auto-detect, or '' for no preference. Note that one some platforms, such as Chrome, attempting to play PQ content may cause problems Defaults to 'auto'.

videoPreference.videoCodecs: Array of String

The list of preferred video codecs, in order of highest to lowest priority.

const videoPreference = {};
videoPreference.label = 'Français';
videoPreference.videoHdr = 'HLG';
videoPreference.videoCodecs = ['vp9', 'avc1.4d002a'];
const playerSettings = {
  ...
  videoPreference,
  ...
};

audioPreference: Object

audioPreference.lang: String

Sets the preferred language for audio track upon player load. If not set player will opt for the 'main' audio track. The audioPreference.lang setting must be specified as a ISO 639 language code (example: 'en', 'de' or 'pt-BR') and must match a MPEG-DASH or HLS manifest value. Default: {}. Example:

audioPreference.spatialAudio: Boolean

If true, a spatial audio track is preferred.

audioPreference.audioCodecs: Array of String

The list of preferred audio codecs, in order of highest to lowest priority.

audioPreference.label: String

Sets the preferred audio track upon player load based on track label (based on manifest data).

const audioPreference = {};
audioPreference.lang = 'fr';
audioPreference.spatialAudio = true;
audioPreference.audioCodecs = ['opus', 'mp4a.40.2'];
audioPreference.label = 'Français avec audio description';
const playerSettings = {
  ...
  audioPreference,
  ...
};

subtitlePreference: Object

subtitlePreference.lang: String

Sets the preferred language for text track upon player load. If not set player will opt for the 'main' text track. The subtitlePreference.lang setting must be specified as a ISO 639 language code (example: 'en', 'de' or 'pt-BR') and must match a MPEG-DASH or HLS manifest value. Default: {}. Example:

subtitlePreference.role: String

The preferred role to use for text tracks.

subtitlePreference.textFormats: Array of String

The list of preferred text formats, in order of highest to lowest priority.

const subtitlePreference = {};
subtitlePreference.lang = 'fr';
subtitlePreference.role = 'commentary';
subtitlePreference.textFormats = ['text/vtt'];
const playerSettings = {
  ...
  subtitlePreference,
  ...
}

Low-latency (LL-DASH)

lowLatencyMode: Boolean

Support for Low-latency live MPEG-DASH needs to be explicitly activated. Default:false.

CMCD (Common-Media-Client-Data) support

enableCMCD: Boolean

Enables CMCD data to be passed with manifest/chunks/license requests. Default behaviour is to pass those data through URI query string. Default: false.

useHeadersForCMCD: Boolean

Pass CMCD data through HTTP request headers instead of URI query string. Default: false.

cmcdContentId: string

If not specificed the player will try to use contentMetadata.id for cmcdContentId. With this setting you can specify a custom cmcdContentId. Default: ''.

cmcdSessionId: string

If not specificed the player will automatically create a cmcdSessionId (UUID). With this setting you can specify a custom cmcdSessionId. Default: ''.

cmcdIncludeKeys: String[]

Takes an array of CMCD keys to include in client requests.. Default: [].

CMSD (Common Media Server Data) support

We support CMSD (Common Media Server Data) mb, etp and rtt properties. This feature needs to be enabled explicitly.

enableCMSD: Boolean

Sets player to read and onboard CMSD data (mb, etp and rtt properties). Default: false.

Retry parameters

retryParameters: Object

This represents an Object to pass to the player to specify specific retry parameters when attempting to load MPEG-DASH content with Shaka player. The following example shows the default player parameters:

retryParameters: {
  manifest: {
    timeout: 25000, // timeout in ms, after which we abort a request
    maxAttempts: 3, // the maximum number of requests before we fail
    delay: 1000 // the base delay in ms between retries
  },
  levels: { // levels property only applies to HLS (when using hlsEngine: "shakaplayer")
    timeout: 25000,
    maxAttempts: 3,
    delay: 1000
  },
  segment: {
    timeout: 15000,
    maxAttempts: 5,
    delay: 1000
  },
  drm: {
    timeout: 25000,
    maxAttempts: 3,
    delay: 1000
  }
}

Custom config

You may pass to the player any parameter available with Shaka player using the shakaCustomConfig setting:

shakaCustomConfig: Object

Allow passing a custom config object to Shaka player. As such, any Shaka player internal setting can be tuned. Note that settings in shakaCustomConfig will complement and override any other Shaka player settings set with other player settings. Default: {}. Example:

shakaCustomConfig: {
  abr: {
    bandwidthDowngradeTarget: 0.95,
    bandwidthUpgradeTarget: 0.85,
    enabled: true,
    switchInterval: 8
  }
}

shakaFullCustomConfig: Object

Allow passing a full custom config object to Shaka player. This is mostly used for debugging. All player settings related to Shaka player will be overridden with those found in shakaFullCustomConfig or reset to Shaka player default if not specified. The main difference with shakaCustomConfig is that shakaFullCustomConfig will reset to Shaka player default unspecified values (instead of using Radiant Media Player default values). Default: {}. Example:

Custom HTTP headers

The player can pass custom HTTP headers for MPEG-DASH manifest, segment and/or DRM license requests. Example:

const shakaRequestConfiguration = {
  manifest: {
    headers: {
      'Auth-Header': 'abc-token-abc'
    }
  },
  segment: {
    headers: {
      'Auth-Header': 'abc-token-abc'
    }
  },
  license: {
    headers: {
      'Auth-Header': 'abc-token-abc'
    }
  }
};
const settings = {
  licenseKey: 'your-license-key',
  src: {
    dash: 'https://your-dash-url.mpd'
  },
  width: 640,
  height: 360,
  shakaRequestConfiguration
};

Buffer settings

shakaMaxBufferAhead: Number

Maximum front buffer size in seconds that the player can reach. When this value is reached the player will stop downloading chunks until further content has been consumed. Default: 30. It generally is best to use the default value.

shakaMaxBufferBehind: Number

Maximum back buffer size in seconds that the player can reach. The player will progressively remove already consumed content from the buffer passed that mark. Default: 30. It generally is best to use the default value.

MPEG-DASH with Multiple Audio Tracks

Radiant Media Player supports rendering of multiple audio tracks (different languages or bitrate) with MPEG-DASH. When the player detects multiple audio tracks within a MPEG-DASH manifest it will automatically display the audio tracks selection module (headset icon). Also see Audio tracks API.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2025 Radiant Media Player. All Rights Reserved.