H5Player uniformly uses the onError hook for error output, and the access party can obtain the errors through this hook for error display, etc.
grammar
Callback Format
| Parameters | Type | Description | |
|---|---|---|---|
| errorType | String | Error type, please refer to subsequent field details for details. | |
| subErrorType | String | Error details | |
| description | String | Error description, which is the Chinese meaning of subErrorType | |
| info: Object | devId | String | Device No |
| code | Number | Detailed error code. If the above code is SERVER_ERROR, then the code is the s17 media service interface error code | |
| message | String | error message | |
| deviceInfos | Array | Device information list, format [devInfo], devInfo: { channel: Number, devId: String } | |
| time | String | The time the error occurred. Format YYYY-MM-DD HH:mm:ss | |
| level | Number | Is it the channel level or the entire player level. 1: Player level, 2: Channel level. Generally used for playback. |
Code Example
Field details
Mainly divided into 4 categories:
| Parameters | Description |
|---|---|
| NETWORK_ERROR | Network errors, including errors returned by the network and s17 service |
| MEDIA_ERROR | Media-related errors during playback, such as format errors, decoding issues, etc. |
| OTHER_ERROR | Errors that occur during non-playback processes, such as default errors in required fields |
| PARAM_ERROR | Parameter error, sdk parameter error and s17 parameter error |
Quite the former is more detailed
| error(SubErrorTypes) | describe(Description) |
|---|---|
| OTHER_ERROR | |
| H5_SDK_HTTPS_REQUIRED | The website needs to use the 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 | Device interruption |
| H5_SDK_SERVER_ERROR | Server error (including other errors in the s17 interface except the following four) |
| H5_SDK_INVALID_DEVICE | Invalid device |
| H5_SDK_DEVICE_IS_OCCUPIED | Device occupation |
| H5_SDK_REQUEST_TIMEOUT | Request timeout |
| H5_SDK_DEVICE_OFFLINE | Device offline |
| H5_SDK_SEEK_FAILED | seek failed |
| MEDIA_ERROR | |
| H5_SDK_UNPACK_EXCEPTION | Decapsulation exception |
| H5_SDK_DECRYPTION | Decryption (AES) exception |
| H5_SDK_DECODING_EXCEPTION | Decoding exception |
| PARAM_ERROR | |
| H5_SDK_PARAM_SDK_ERROR | sdk parameter error |
| H5_SDK_PARAM_S17_ERROR | s17 parameter error |
| Parameters | Description |
|---|---|
| code:string | s17 service error code |
| message:string | Error message |
| time:Date | The time when the error occurred |
| level: string | error level; |
| deviceinfos:[] | Device information (including devid, channel, etc.) |