Client Event Notification (HWLLSClientEvent)
This section describes the HWLLSClientEvent APIs of the LLL web SDK.
|
API |
Description |
|---|---|
|
Media statistics event. |
|
|
Network quality report event. |
|
|
Video streaming interruption event (waiting for recovery). |
|
|
Audio streaming interruption event (waiting for recovery). |
|
|
Video streaming resumption event (playback resumed). |
|
|
Audio streaming resumption event (playback resumed). |
|
|
Audio playback start event. |
|
|
Video playback start event. |
|
|
Video playback pause event. |
|
|
Full-screen view event. |
|
|
Playback downgrade event. |
|
|
Client error event. |
Registration listening must be canceled when the service ends. Otherwise, memory leakage may occur when there are a certain number of registration listening events.
media-statistic
[Event Description]
Media statistics event. This event is used together with the streamStatistic method.
[Callback Parameters]
StatisticInfo: media statistics. The value type is StatisticInfo.
StatisticInfo is defined as follows: {
- video: {
codec: string; // Media format
bitRate: number; // Bitrate (kbit/s)
packetsReceived?: number; //Total number of received packets
packetsLost?: number; //Total number of lost packets
jitterBufferDelay?: number; // Jitter delay (ms)
frameRate: number; // Frame rate (fps)
frameDecodedRate?: number; // Decoded frame rate (fps)
width: number; // Width
height: number; // Height
framesReceived?: number; // Total number of received frames
framesDecoded?: number; // Total number of decoded frames
framesDropped?: number; // Total number of dropped frames
nackCount?: number; // Total number of retransmitted packets
firCount?: number; // Total number of fir requests
pliCount?: number; // Total number of pli requests
frameDecodeAvgTime?: number; // Average decoding delay
freeze200Count: number; // 200 ms freeze count
freeze200Duration: number; // 200 ms freeze duration
freeze600Count: number; // 600 ms freeze count
freeze600Duration: number; // 600 ms freeze duration
}
- audio: {
codec: string; // Media format
bitRate: number; // Bitrate (kbit/s)
packetsReceived?: number; //Total number of received packets
packetsLost?: number; //Total number of lost packets
jitterBufferDelay?: number; // Jitter delay (ms)
audioLevel?: number; // Volume level
freeze200Count: number; // 200 ms freeze count
freeze200Duration: number; // 200 ms freeze duration
}
}
network-quality
[Event Description]
Network quality report event.
[Callback Parameters]
NetworkQualityTypes: network quality details. The type is NetworkQualityTypes.
The enumerated values of NetworkQualityTypes are as follows:
- NETWORK_QUALITY_UNKNOW = 0: The network quality is unknown.
- NETWORK_QUALITY_GREAT = 1: The network quality is excellent.
- NETWORK_QUALITY_GOOD = 2: User experience is almost the same as that of value 1, but the bitrate may be slightly lower.
- NETWORK_QUALITY_DEFECTS = 3: User experience is defective but the watching is not affected.
- NETWORK_QUALITY_WEAK = 4: The network quality is poor and the video is not smooth.
- NETWORK_QUALITY_BAD = 5: The network quality is so poor that user experience is severely affected.
- NETWORK_QUALITY_DISCONNECT = 6: The network quality is poor and even disconnection occurs. The video cannot be watched.
video-broken
[Event Description]
Video streaming interruption event (waiting for recovery).
[Callback Parameters]
None
audio-broken
[Event Description]
Audio streaming interruption event (waiting for recovery).
[Callback Parameters]
None
video-recovery
[Event Description]
Video streaming resumption (non-EOF) event (playback resumed).
[Callback Parameters]
None
audio-recovery
[Event Description]
Audio streaming resumption (non-EOF) event (playback resumed).
[Callback Parameters]
None
video_stuck
[Event Description]
Video playback pause event.
[Callback Parameters]
Boolean value. True indicates paused, and False indicates not paused.
fullscreen-status-changed
[Event Description]
Full-screen view event.
[Callback Parameters]
- isFullScreen: indicates whether to enable full-screen display
- isPause: indicates whether to stop playback
Indicates the downgrade information. The value is a string.
- webrtc: LLL playback
- hls: HLS playback
- flv: FLV playback
Error
[Event Description]
This event is triggered when an unrecoverable client error occurs.
[Callback Parameters]
errorInfo: (mandatory) error information. The value is of the HwLLSError type.
errorInfo is defined as: {
code: (mandatory) error code. The type is number.
message: (mandatory) error description. The type is string.
getCode (): (mandatory) returned error code. The type is number.
getMsg (): (mandatory) returned error description. The type is string.
}
If the network firewall is restricted (UDP port restriction) or playback fails on LLL for multiple times, you can downgrade the playback based on the specified error code (HWLLS_MEDIA_NETWORK_ERROR or HWLLS_PLAY_WEBRTC_RETRY_FAILED). For details, see SDK Usage.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.