Documentation

Error Management

Player-level unified error and warning

Error API events

error

The player has encountered a fatal error and cannot recover from it. This will result in an error message being displayed to the viewer. This error message can be tuned through player labels

warning

The player has encountered a non-fatal error. Either it could recover from the error or this warning may not interfere with playback (but may make some features unavailable)

Error API methods

getErrorData()

rmp.getErrorData();

Returns Object representing the (error|warning) that was just emitted by the player. When available this object will have the following properties offering more details on the (error|warning):

{
    code: Number, // the (error|warning) number
    message: String, // the (error|warning) message
    event: (Object|null), // the native (error|warning) DOM or library-specific event if available
    fatal: Boolean // if the error fatal (error) or not (warning)
}

Error player setting

errorOnlyShowCustomText: Boolean

By default, when a fatal error is detected the player will display the following data: error code, error details and custom error message (as read in hint.error.customErrorMessage label). Setting errorOnlyShowCustomText to true will hide error code, error details to only show custom error message. Default: false.

Error codes and messages

For values obtained through the getErrorData API method:

error

  • 100: error on HTML5 media element
  • 101: error loading or parsing input playlist
  • 102: error loading or parsing input related
  • 104: could not launch player - destroy has been requested in the meantime due to invalid license
  • 105: id parameter for new RadiantMP is not a string or is an empty string - exit
  • 106: could not find player container with id on page - exit
  • 107: no playback support
  • 200: failed to load required lib hls.js
  • 201: hls.js fatal error - cannot recover
  • 202: IMA DAI backup stream not provided - cannot recover
  • 203: hls.js fatal error - manifest parsing error
  • 204: hls.js fatal error - network error
  • 205: hls.js fatal error - incompatible codecs error
  • 206: hls.js fatal error - decoding media error
  • 300: failed to load required lib Shaka player
  • 301: Shaka player error - cannot recover
  • 302: shaka.Player.isBrowserSupported returned false - cannot use Shaka player in this environment
  • 303: Shaka player fatal error - error from the network stack
  • 304: Shaka player fatal error - error from parsing text streams
  • 305: Shaka player fatal error - error parsing or processing audio or video streams
  • 306: Shaka player fatal error - error parsing the manifest
  • 307: Shaka player fatal error - error related to streaming
  • 308: Shaka player fatal error - errors related to DRM
  • 309: Shaka player fatal error - error in the database storage (offline)
  • 500: failed to load required lib three.js (360° video)
  • 600: FPS failed to retrieve the FPS server certificate
  • 601: FPS key System not supported
  • 602: FPS could not create MediaKeys
  • 603: FPS could not create key session
  • 604: FPS license request failed

warning

  • 1000: failed to load logo at provided URI
  • 1001: failed to load poster at provided URI
  • 1002: failed to load animated poster at provided URI
  • 1003: fullscreenerror
  • 1004: destroy currently running - wait for destroycompleted event
  • 1005: setSrc currently running - wait for srcchanged event
  • 1006: cannot append playlist layout - missing rmp-playlist-container container
  • 1009: failed to enter picture to picture mode
  • 1012: not ready - cannot initiate playback - exit
  • 1013: player ready but hls.js is not instantiated yet - cannot initiate playback - exit
  • 1014: warning on HTML5 media element
  • 2000: hls.js warning
  • 3000: Shaka player warning
  • 3001: storage has not been initialized -shakaOffline setting is set to false or stream is not on-demand
  • 3002: could not download offline content
  • 3003: could not list offline downloaded content
  • 3004: could not remove offline downloaded content
  • 3005: could not load offline content - invalid input
  • 3006: could not query temporary storage usage and availability
  • 3007: offline storage is not supported in this environment
  • 3008: could not abort download of offline content
  • 4000: failed to load vtt.js
  • 4001: vtt.js parsing error
  • 4002: failed to load text track at provided URI
  • 6000: FPS decryption key error was encountered
  • 6001: FPS video playback error occured
  • 7000: failed to load cast_sender.js dependency
  • 7001: castSession.loadMedia failed on receiving device
  • 7002: failed at selecting receiver device
  • 7003: failed at initializing Google Cast Cordova
  • 8000: failed to load VTT thumbnail file at URI
  • 8001: failed to load sprite image at URI
  • 8002: not a valid VTT file - no further action taken
  • 8003: could not parse thumbnails VTT file - corrupted data found
  • 9000: error parsing JSON for custom icons
  • 9001: error loading JSON for custom icons
  • 9002: not a valid VTT transcripts file - no further action taken
  • 9003: could not parse transcripts VTT file - corrupted data found
  • 9004: cannot append transcripts layout - missing rmp-transcripts-container container
  • 9005: failed to load VTT transcripts file
  • 10000: failed to load optional library rmp-vast - no ad will be shown
  • 10001: failed to load optional library Google IMA SDK - no ad will be shown
  • 12000: setAudioTrack API input parameter is not a number - exit
  • 12001: setAudioTrack API input parameter is out of bound - exit
  • 13000: Google tag is not installed on this page -> cannot send data to Google Analytics
  • 14000: Floating feature requires an anchor element, this element appears to be missing -> disabling feature
  • 15000: Failed at loading chapters WEBVTT file
  • 15001: Not a valid WEBVTT file for chapters - exit

Player code example for error management API

<script src="https://cdn.radiantmediatechs.com/rmp/9.16.4/js/rmp.min.js"></script>
<div id="rmp"></div>
<script>
const src = {
  hls: 'https://your-hls-url.m3u8'
};
const settings = {
  licenseKey: 'your-license-key',
  src: src,
  width: 640,
  height: 360,
  contentMetadata: {
    poster: [
      'https://your-poster-url.jpg'
    ]
  }
};
const elementID = 'rmp';
const rmp = new RadiantMP(elementID);
// Listening for (error|warning) events
rmp.on('error', () => {
  console.log('fatal error detected');
  console.log(rmp.getErrorData());
});
rmp.on('warning', () => {
  console.log('non-fatal error detected');
  console.log(rmp.getErrorData());
});
// Player initialisation only after API events are registered
rmp.init(settings);
</script>

Advanced error management with hls.js and Shaka player

hls.js and Shaka player offer advanced error data that are also exposed by the player unified error management design.

hls.js

The list of errors provided by hls.js in its API can be found here. Here is an example of how to extract those errors information in Radiant Media Player:

rmp.on('error', () => {
  const errorData = rmp.getErrorData();
  if (errorData.code === 201) {
    const data = errorData.event;
    if (data) {
      console.log(data.type);
      console.log(data.fatal);
      console.log(data.details);
      // Other properties from the data Object may be available - see hls.js docs
    }
  }
});

In the same way we can listen for hls.js warning

rmp.on('warning', () => {
  const errorData = rmp.getErrorData();
  if (errorData.code === 2000) { 
    const data = errorData.event;
    if (data) {
      console.log(data.type);
      console.log(data.fatal);
      console.log(data.details);
      // Other properties from the data Object may be available - see hls.js docs
    }
  }
});

Shaka player

The list of errors provided by Shaka player in its API can be found here. This notably includes error management for DRM (Widevine, PlayReady, ClearKey - FairPlay streaming errors are directly available at player level). Here is an example of how to extract those errors information in Radiant Media Player:

rmp.on('error', () => {
  const errorData = rmp.getErrorData();
  if (errorData.code === 301) {
    const data = errorData.event;
    if (data) {
      console.log(data.category);
      console.log(data.code);
      console.log(data.message);
      // Other properties from the data Object may be available - see Shaka player docs
    }
  }
});

In the same way we can listen for hls.js warning

rmp.on('warning', () => {
  const errorData = rmp.getErrorData();
  if (errorData.code === 3000) {
    const data = errorData.event;
    if (data) {
      console.log(data.category);
      console.log(data.code);
      console.log(data.message);
    }
  }
});

Video ads error management

Due to the unique nature of video ads error handling, ad error management is dealt with for each VAST parser offered by the player:

Offline API error management

See the offline API docs here.

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.