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). Where media source extensions support is not available (e.g. iOS, older Android) we fallback to native HLS to HTML5 video, provided the player has a valid HLS stream as an input setting.

Supported MPEG-DASH features

  • 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)
  • Live, DVR and on-demand media content
  • Optimized adaptive bitrate streaming with automatic or manual bitrate selection
  • Multiple-audio tracks
  • Multiple WebVTT or TTML tracks (subtitles/captions)
  • DRM (PlayReady, Widevine, ClearKey)
  • Multi-period content (static and dynamic)
  • Xlink elements (actuate=onLoad only, resolve-to-zero, fallback content)
  • Audio-only
  • Resilience to errors

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/9.15.12/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',
  // For older devices and iOS where MPEG-DASH is not supported, we provide a HLS (or MP4) fallback
  hls: 'https://your-hls-url.m3u8'
};
const settings = {
  licenseKey: 'your-license-key',
  src: src,
  width: 640,
  height: 360,
  // Here we need to state that MPEG-DASH is preferred over HLS, when both are available on the device
  dashFirst: true,
  contentMetadata: {
    poster: [
      'https://your-poster-url.jpg'
    ]
  }
};
const rmp = new RadiantMP('rmp');
rmp.init(settings);
</script>

Player settings for MPEG-DASH streaming

General

dashFirst: Boolean

When used in conjonction with HLS this setting will tell the player to pick MPEG-DASH (where supported) as a first choice over HLS (picking HLS as a first choice is the player default). MPEG-DASH (where supported) is always picked first over MP4/WebM progressive download. Default: false.

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?

Bandwidth can be expensive. Not only for you as a streaming service (cost of CDN and/or origin streaming servers) but also for your viewers. There is very little point to throw a 1080p rendition in a player that is 640x360 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.

ignoreDevicePixelRatio: Boolean

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

preferredVideoHdr: String

By default the player test for HDR support in the targeted environment and then opt for a HDR video track when available and where HDR video is supported. This setting tells the player to prefer a certain flavour of HDR video content or to ignore HDR video tracks even if supported. Possible values are: 'SDR', 'PQ', 'HLG' or 'auto'. Default: 'auto'.

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 request manifest, segment or DRM data. For manifest and segment this setting can be used to make requests with credentials. This will allow cookies in cross-site requests. See here for more information. Example:

shakaRequestConfiguration: {
  manifest: {
    credentials: true
  },
  segment: {
    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.

shakaIgnoreMinBufferTime: Boolean

In Media Presentation Description (MPD), minBufferTime specifies a common duration used in the definition of the Representation data rate. This setting allows for ignoring the minBufferTime value in the manifest therefore letting the player set the minBufferTime value. Default: false.

shakaStartAtSegmentBoundary: Boolean

If true, adjust the start time backwards so it is at the start of a segment. This affects both explicit start times and calculated start time for live streams. This can put us further from the live edge but may resolve some live start-up issues. Default: false.

shakaInaccurateManifestTolerance: Boolean

The maximum difference, in seconds, between the times in the manifest and the times in the segments. Larger values allow us to compensate for more drift in live streams (up to one segment duration). Smaller values reduce the incidence of extra segment requests necessary to compensate for drift. Default: 2.

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.

preferSpatialAudio: Boolean

When set to true, the player will prefer spatial audio tracks when available. Defaults to false.

Language preference

audioPreference: Object

audioPreference.lang: String

Sets the preferred language for audio track upon player load. This is done through the lang property of audioPreference object. 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:

const audioPreference = {};
audioPreference.lang = 'fr';
const playerSettings = {
  ...
  audioPreference: audioPreference,
  ...
}

audioPreference.label: String

Sets the preferred audio track upon player load based on track label. Example:

const audioPreference = {};
audioPreference.label = 'Português com audiodescrição';
const playerSettings = {
  ...
  audioPreference: audioPreference,
  ...
}

Note that the audio track with the input label must exist in the MPEG-DASH manifest for this property to have effect.

subtitlePreference: Object

subtitlePreference.lang: String

Sets the preferred language for text track upon player load. This is done through the lang property of subtitlePreference object. 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:

const subtitlePreference = {};
subtitlePreference.lang = 'fr';
const playerSettings = {
  ...
  subtitlePreference: subtitlePreference,
  ...
}

Low-latency (LL-DASH)

autoLowLatencyMode: Boolean

By default player auto-detect LL-DASH streams and configure itself for LL-DASH support when a LL-DASH stream is detected. If you want to disable LL-DASH detection/configuration set this setting to false. Default: true.

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: ''.

CMSD (Common Media Server Data) support

With Radiant Media Player 9.13.0 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: 20000, // 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: 20000,
    maxAttempts: 3,
    delay: 1000
  },
  segment: {
    timeout: 12000,
    maxAttempts: 5,
    delay: 1000
  },
  drm: {
    timeout: 12000,
    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 (complement and override if applicable) 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. All player settings related to Shaka player will be overridden with those found in shakaFullCustomConfig or otherwise reset to Shaka player default if not specified. Default: {}. Example:

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.

Common troubleshooting steps

If you are having a start-up issue (delayed playback or video/audio artifacts) with a live MPEG-DASH stream you can try the following settings:

shakaIgnoreMinBufferTime: true,
shakaStartAtSegmentBoundary: true,
shakaInaccurateManifestTolerance: 0,
autoLowLatencyMode: false // if your stream is not a low-latency stream - otherwise leave to true

Enabling Radiant Media Player debug mode can also help identify issues though your browser developer tools.

If you have taken reasonable troubleshooting steps and are still experiencing an issue while trying to play a MPEG-DASH stream with our player, please open a technical support ticket - we will do our best to help.

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

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