Documentation

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)
  • Multiple periods
  • 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 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/8.1.2/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 DASH (where supported) as a first choice over HLS (picking HLS as a first choice is the player default). 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.

shakaPreferredAudioLanguage: String

The preferred language to use for audio tracks. If not given it will use the 'main' track. This must be specified as a language code (example: 'en', 'de' or 'pt-BR') and must match a DASH manifest value. See https://tools.ietf.org/html/rfc5646 and http://www.iso.org/iso/home/standards/language_codes.htm for more information. Default: ''.

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 DASH DRM documentation page for more advanced use-case.

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.

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.

Captions

For information on closed captions styling (FCC compliant) see this article.

shakaStreamingIgnoreTextStreamFailures : Boolean

If true, the player will ignore text stream failures and proceed to play other streams. Default: true.

shakaPreferredTextLanguage: String

The preferred language to use for text tracks. If a matching text track is found, and the selected audio and text tracks have different languages, the text track will be shown. Changing this during playback will not affect the current playback. Default: ''.

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

Retry parameters

retryParameters: Object

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

retryParameters: {
  manifest: {
    timeout: 12000, // timeout in ms, after which we abort a request
    maxTimeout: 72000, // maximum timeout in ms for all attempts before we fail
    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: 12000,
    maxTimeout: 72000,
    maxAttempts: 5,
    delay: 1000
  },
  segment: {
    timeout: 24000,
    maxTimeout: 72000,
    maxAttempts: 7,
    delay: 1000
  },
  drm: {
    timeout: 12000,
    maxTimeout: 72000,
    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 this may override any setting previously documented on this page. Default: {}. Example:

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

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: 20. 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 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 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-2022 Radiant Media Player. All Rights Reserved.