Help Center/ Live/ Low Latency Live Client SDK Reference/ Web SDK/ API Reference/ Client Event Notification (HWLLSClientEvent)
Updated on 2024-10-30 GMT+08:00

Client Event Notification (HWLLSClientEvent)

This section describes the HWLLSClientEvent APIs of the LLL Web SDK.

Table 1 HWLLSClientEvent APIs

API

Description

media-statistic

Media statistics event.

network-quality

Network quality report event.

video-broken

Video stream interruption event.

audio-broken

Audio stream interruption event.

video-recovery

Video streaming resumption event.

audio-recovery

Audio streaming resumption event.

audio-start

Audio playback start event.

video-start

Video playback start event.

video-stuck

Video playback pause event.

fullscreen-status-changed

Full-screen view event.

player-changed

Playback downgrade event.

Error

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: {

    mediaType: media type

    frameRate: video frame rate. The type is number.

    width: video width. The type is number.

    height: video height. The type is number.

    jitter: jitter. The type is number.

    bitRate: bitrate (in kbit/s). The type is number.

    bytesReceived: number of received bytes. The type is number.

    packetsReceived: number of received packets. The type is number.

    packetsLost: number of lost packets. The type is number.

    }

  • audio: {

    mediaType: media type

    jitter: jitter. The type is number.

    bitRate: bitrate (in kbit/s). The type is number.

    bytesReceived: number of received bytes. The type is number.

    packetsReceived: number of received packets. The type is number.

    packetsLost: number of lost packets. The type is number.

    }

}

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 stream interruption event.

[Callback Parameters]

None

audio-broken

[Event Description]

Audio stream interruption event.

[Callback Parameters]

None

video-recovery

[Event Description]

Video streaming (non-EOF) resumption event.

[Callback Parameters]

None

audio-recovery

[Event Description]

Audio streaming (non-EOF) resumption event.

[Callback Parameters]

None

audio-start

[Event Description]

Audio playback start event.

[Callback Parameters]

None

video-start

[Event Description]

Video playback start event.

[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

player-changed

[Event Description]

Playback downgrade event.

[Callback Parameters]

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 type is ErrorInfo.

ErrorInfo is defined as: {

errorCode: (mandatory) error code. The type is string.

errorMsg: (mandatory) 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.