The H5Player utilizes a unified onError hook for error output. This hook allows access partners to capture and display errors as needed.
Syntax
Callback Format
Parameter | Type | Description | |
---|---|---|---|
info: Object | devId | String | Device number |
code | Number | The detailed error code. If the code is SERVER_ERROR, this will be the s17 media service error code. | |
errorType | String | The type of error. Please refer to the following section for field descriptions. | |
subErrorType | String | The error details. | |
message | String | Error message | |
level | Number | It specifies whether the error is channel-specific or applies to the entire player. 1 for player-level errors, and 2 for channel-level errors. It is generally used for playback. | |
errorInfo | object | Custom parameter |
Code Example
Field Descriptions
There are 4 main categories:
Parameter | Description |
---|---|
NETWORK_ERROR | The network-related errors, including issues with s17 service responses. |
MEDIA_ERROR | The errors related to media playing, such as format issues or decoding problems. |
OTHER_ERROR | The errors that occur outside of the playing process, such as missing required fields. |
PARAM_ERROR | The parameter-related errors, including SDK and s17 parameter issues. |
It is more detailed than the previous category.
Error (SubErrorTypes) | Description |
---|---|
OTHER_ERROR | |
H5_SDK_HTTPS_REQUIRED | Website must use HTTPS protocol |
H5_SDK_OPERATION_ERROR | Operation error |
H5_SDK_NO_MICROPHONE_PERMISSION | No microphone permission |
H5_SDK_WEBSOCKET_ERROR | WebSocket error |
NETWORK_ERROR | |
H5_SDK_INVALID_URL | Invalid URL |
H5_SDK_STREAM_ABORT | Stream interruption |
H5_SDK_SERVER_ERROR | Server error (includes S17 interface errors except the following four) |
H5_SDK_INVALID_DEVICE | Invalid device |
H5_SDK_DEVICE_IS_OCCUPIED | Device occupied |
H5_SDK_REQUEST_TIMEOUT | Request timeout |
H5_SDK_DEVICE_OFFLINE | Device offline |
H5_SDK_SEEK_FAILED | Seek failed |
H5_SDK_NETWORK_ERROR | Network error |
MEDIA_ERROR | |
H5_SDK_UNPACK_EXCEPTION | Demuxing exception |
H5_SDK_DECRYPTION | AES decryption exception |
H5_SDK_DECODING_EXCEPTION | Decoding exception |
H5_SDK_CURRENT_TIME_ERROR | Current time error |
H5_SDK_CACHE_MORE_THAN_2S | Cache exceeds 2 seconds |
PARAM_ERROR | |
H5_SDK_PARAM_SDK_ERROR | SDK parameter error |
H5_SDK_PARAM_S17_ERROR | S17 parameter error |
STREAM_TYPE_INVALID | Invalid stream type |
SERVER_ERROR | |
RESOURCE_NOT_AVAILABLE | Resource unavailable |
NO_GPU_RESOURCE | Insufficient GPU server resources |
VIDEO_OVER_LOAD | GPU server overload |