Skip to main content

Error Codes

info

The library follows hexadecimal error system. The least significant 16-bits (Bits 0-15) indicate a Component Error Code and the most significant 16-bits (Bits 16-31) indicate the Categories that the error falls into.

Error CategoryMaskDescription
Network Error0x10000Indicates that the error occurrence is network. related
Server Error0x20000Indicates a server response failure.
Third party Error0x40000Indicates a failure in third party components such as External Player, Third party Libraries etc.,
Reserved0x80000Reserved for future use.
Reserved0x100000Reserved for future use.
Reserved0x200000Reserved for future use.
Playback Error0x400000Indicates that the error occurrence is during a Playback.
Interpretation of Errors
  • 0x40* - Playback Error most probably due to player itself.
  • 0x41* - Playback error due to Network failure.
  • 0x42* - Playback error due to Server response failure.
Error CodeHexadecimal valueComponent Error CodeDescription
MEDIA_SOURCE_FAILURE0x4002010x201Indicates that an error has occurred while loading the MediaSource.
MEDIA_SOURCE_TIMEOUT0x4002020x202Indicates that Fetching of the Media Source from network timed-out.
DRM_PROVISIONING_FAILURE0x4002030x203Indicates that an error has occurred while Provisioning Model Certificates on the specific device.
DRM_PROVISIONING_TIMEOUT0x4002040x204Indicates that Fetching of DRM Provisioning Data from Network Timed-Out.
DRM_LICENSE_FAILURE0x4002050x205Indicates that an error has occurred while Loading DRM Keys for a particular content either from network (or) persistent storage.
DRM_LICENSE_TIMEOUT0x4002060x206Indicates that Fetching of DRM Keys from network timed-out.
DRM_LICENSE_EXPIRED0x4002070x207Indicates that Loaded DRM Keys are expired.
MEDIA_PLAYBACK_FAILURE0x4002080x208Indicates that rendering of media failed.
MEDIA_PLAYBACK_STALE0x4002090x209Indicates Player playback has stalled.
SYSTEM_FAILURE0x40020B0x20BIndicated that Unsupported device action or incompatible output devices are used.
BUFFER_TIMEOUT0x4002150x215Indicated that Buffering timeout has occured.

Error Object

The Error object returned by the library is a linked list that traces the error occurrence from an higher-level component, to the lower-level component where the error actually occurred.

Example

The Player component can talk to an internal component that in turn talks to head-end server. If the server returns an error-ful response, the Error object returned from the player component might have internalError property set to the error thrown by the internal component which might actually be a server error information.

The more deeper we go in the linked list , the more specific the Error would be. It's up to the application developers to utilize the depth of Error information as they desire.

interface Error {
/**
* Unique Error Code with all Category Masking Set.
*/
errorCode: number;
/**
* Error message describing the Error.
*/
errorMessage?: string;
/**
* The internal root-cause of the Error if any.
*/
internalError?: Error;
/**
* The internal Contextual description of the Error if any.
* This is usually set if the error is from a third-party source.
*/
contextDescription?: string;
/**
* A Computed property that returns the component error code
* removing all CATEGORY MASK.
*/
componentErrorCode?: number;
}

Player Restart

We recommend configuring the player to restart automatically on encountering errors 0x40020B and 0x400215 to improve playback reliability.


// Handling error `40020B` & `400215`
player.subscribe("error", function (error) {
if (error.hexErrorCode === "400215" || error.hexErrorCode === "40020B" ) {
// Re-prepare the player (re-authorize and create a new player instance).
}
});