Radiant Media Player

Using fallback streaming URL

Documentation sections

backupBitrates player setting

Radiant Media Player provides support for fallback streaming URLs through the backupBitrates player setting. This features is supported for HLS, DASH or progressive download. It will work for live, DVR and on-demand streaming.

At a given point in time a specific streaming URL may become unavailable. This could be caused by server outage or overload. At player start-up Radiant Media Player is able to detect this kind of failure when it attempts to fetch media content from the server. In the event it cannot access the initial resource the player can automatically switch to an alternate backup resource thus increasing the chance for your viewers to still be able to access your content. With backupBitrates setting, the check for stream availability happens when initial playback is requested. To handle in-stream playback/network error you can do one of the following:

  • For HLS use the redundant streams feature described in the next section
  • Listen to the player API error event and implement some custom fallback

It should be noted that the player will only use fallback streaming URL for a like-like streaming protocol. This means that if the player opts for HLS streaming in a specific environment it expects to have an HLS back-up streaming URL (e.g. it will not fallback to DASH or progressive download even if available).

In this example we use a HLS fallback streaming URL. Fallback information are passed to the player through the backupBitrates setting which is an Object like the bitrates setting.

<!-- Include Radiant Media Player JavaScript file in your <body> or <head> -->
<script src="https://cdn.radiantmediatechs.com/rmp/4.10.5/js/rmp.min.js" 
<!-- Set up your wrapper div with its unique id -->
<div id="rmpPlayer"></div>
<!-- Player container element -->
// Your primary streaming source - in this example we use HLS
var bitrates = {
  hls: 'https://your-hls-url.m3u8'
// Your fallback streaming source - must be of same type as above
var backupBitrates = {
  hls: 'https://your-fallback-hls-url.m3u8'
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,
  // Here we tell the player to use fallback asset if primary asset fails to load
  backupBitrates: backupBitrates,
  width: 640,
  height: 360,
  poster: 'https://your-poster-url.jpg'
var elementID = 'rmpPlayer';
var rmp = new RadiantMP(elementID);

The check for fallback streaming URL happens through JavaScript XMLHttpRequest for HTML5 video/audio. Hence your fallback streams must also be delivered with CORS headers permitting GET requests.

HLS redundant streams

This error resilience feature is specific to HLS. More information on the subject can be found here.

In a nutshell: "If your playlist contains alternate streams, they can not only operate as bandwidth or device alternates, but as failure fallbacks. If the client is unable to reload the index file for a stream (due to a 404 error, for example), the client attempts to switch to an alternate stream".

Note that this feature is a complement to the previously mentioned fallback mechanism. This mechanism can actually allow recovery of in-stream errors. Fallback information needs to be presented in the HLS manifest.

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