Documentation

Radiant Media Player

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/6.4.10/js/rmp-shaka.min.js"></script>
<!-- Player container element -->
<div id="rmpPlayer"></div>
<!-- Set up player configuration options -->
<script>
// Here we pass our MPEG-DASH streaming source
var 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'
};
var 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'
    ]
  }
};
var elementID = 'rmpPlayer';
var rmp = new RadiantMP(elementID);
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.

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

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

shakaSwitchInterval: Number

The minimum amount of time that must pass between switches, in seconds. This keeps us from changing too often and annoying the user. Default: 8.

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.

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. Defaults to false.

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.

shakaStartLevel: Number

Defines the preferred initial bitrate when playback starts. Default: -1.
  • -1: automatic start level selection based on rmp-connection
  • 0: a contextual arbitrary value will be used

shakaManifestDefaultPresentationDelay: Number

A default presentationDelay if suggestedPresentationDelay is missing in the DASH manifest. Default: 0. In DASH, 0 means a default of 1.5 * minBufferTime. In HLS, 0 means a default of 3 * segment duration.

Low-latency (LL-DASH)

shakaAutoLowLatencyMode: String

Enables Low-Latency DASH a.k.a. CMAF-CTE (Chunked Transfer Encoding) for live DASH streaming. 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: ''.

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: 10000, // timeout in ms, after which we abort a request
    maxTimeout: 64000, // 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: 10000,
    maxTimeout: 64000,
    maxAttempts: 5,
    delay: 1000
  },
  segment: {
    timeout: 20000,
    maxTimeout: 64000,
    maxAttempts: 7,
    delay: 1000
  },
  drm: {
    timeout: 10000,
    maxTimeout: 64000,
    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
  }
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2021 Radiant Media Player. All rights reserved.