Error codes on Android
THEOplayer has different types of error events. One of those error events is the "generic player error event". This error event indicates a fatal error, and can be intercepted through the player.
This error event exposes an "error code" to explain the occurred error. An error code may be more interesting to track than a verbose error message. For example, if you are logging errors through an analytics service, it could be useful to filter them by their error code.
An error code is a number (e.g. 2001), and it belongs to a category.
The format of an error code is "[category][sub-code]".
For example, error "2001" belongs to category 2, and has sub-code 001.
If the error is a generic sub-code for its category, then the sub-code is 000.
In other words, error 11000 is the "catch-all" for category 11.
Categories
Each error code belongs to an error category. At the time of writing, there are 11 categories.
- Configuration error: the integrator misconfigured the player.
- License error: the player license is no longer valid, incorrect or not provided.
- Source invalid: the source is not valid, or cannot be played on the current platform.
- Manifest load error: the manifest cannot be loaded or parsed.
- Media not supported: the media cannot be played on the current platform.
- Network error: the network timed out, or is not available.
- Content protection error: anything DRM related. Key system is not supported, invalid license, license expired, key missing, output restricted...
- Subtitle load error: the subtitles cannot be loaded or parsed...
- VR not supported: VR is not available on the current platform, VR presentation cannot be switched.
- Ad blocker detected: an ad has been blocked (or the third party CSAI library was not loaded).
- Fullscreen error: switching to fullscreen is not possible (note: this may be the case when fullscreen was not triggered by user interaction).
Refer to "How to do error handling" to learn how to detect the "generic player error event".
Requesting categories and codes
The error category of an error code is available through
ErrorCategory.fromCode().