CloudHub Docs
Download Documents

RTS


CloudHubRTS Electron

onFirstlocalvideoframe

The callback of the first frame of the local video has been captured.

cRtsPusher.on("onFirstlocalvideoframe",data=>{});
ParametersDescription
sourceIdPush ID
widthThe width of the first video frame
heightThe height of the first frame of video

onVolumeindication

The callback of the first frame of the local video has been displayed.

cRtsPusher.on("onVolumeindication",data=>{});
ParametersDescription
sourceIdPush ID
totalVolumeTotal volume value

onRtsstats

Call statistics

cRtsPusher.on("onRtsstats",data=>{});
ParametersDescription
statsThe specific content of call statistics is as follows:
duration:Talk time, in seconds, cumulative value
txBytes:Number of bytes sent (bytes), cumulative value
rxBytes:Received bytes (bytes), cumulative value
txKBitRate:Transmission bit rate (Kbps), instantaneous value
rxKBitRate:Receive bit rate (Kbps), instantaneous value
rxAudioBytes:The number of received audio bytes (bytes), cumulative value
txAudioBytes:Send audio bytes (bytes), cumulative value
rxVideoBytes: Received video bytes (bytes), cumulative value
txVideoBytes: The number of transmitted video bytes (bytes), cumulative value
rxAudioKBitRate: Audio receiving bit rate (Kbps), instantaneous value
txAudioKBitRate:Audio packet transmission bit rate (Kbps), instantaneous value
rxVideoKBitRate:Video receiving bit rate (Kbps), instantaneous value
txVideoKBitRate:Video transmission bit rate (Kbps), instantaneous value
lastmileDelay:Network latency from client to edge server (milliseconds)
txPacketLossRate:Before using anti-packet technology, the packet loss rate from the client to the CloudHub edge server (%)
rxPacketLossRate:Before using anti-packet technology, CloudHub edge server to client packet loss rate (%)
cpuTotalUsage:The current system’s CPU usage (%).

onAudiodevicestatechanged

The callback of the first frame of the local video has been displayed.

cRtsPusher.on("onAudiodevicestatechanged",data=>{});
参数说明
sourceIdPush ID
deviceIdequipment ID
deviceTypeMedia device type:
-1: Unknown device type
0: Audio playback device
1: Audio recording equipment
2: Video rendering equipment
3: Video capture equipment
4: App’s audio playback device
stateequipment status :
1: The device is in use
2: Device is disabled
4: No such device
8: The device is unplugged

onVideodevicestatechanged

Video device status changes

cRtsPusher.on("onVideodevicestatechanged",data=>{});
ParametersDescription
sourceIdPush ID
stateequipment status :
1: The device is in use
2: Device is disabled
4: No such device
8: The device is unplugged

onVideosizechanged

The callback of the first frame of the local video has been displayed.

cRtsPusher.on("onVideosizechanged",data=>{});
ParametersDescription
sourceIdPush ID
widthVideo width
heightThe height of the video

onPushstateupdated

Push stream status change

cRtsPusher.on("onPushstateupdated",data=>{});
ParametersDescription
state1 => not connected CONNECTION_STATE_DISCONNECTED
2 => Connecting CONNECTION_STATE_CONNECTING
3 => Connection completed CONNECTION_STATE_CONNECTED
4 => Reconnecting CONNECTION_STATE_RECONNECTING
5 => connection failed CONNECTION_STATE_FAILED

onFirstlocalaudioframe

The callback of the first frame of local audio has been captured.

cRtsPusher.on("onFirstlocalaudioframe",data=>{});
ParametersDescription
sourceIdPush ID

onLocalVideoStateChanged

When the status of the local video changes

cRtsPusher.on("onLocalVideoStateChanged",data=>{});
ParametersDescription
sourceIdPush ID
state0 => The default initial state of the local video
1 => The local video capture device started successfully
2 => The first frame of the local video is successfully encoded
3 => Local video failed to start
error1 => The reason for the error is not clear
2 => No permission to start local video capture device
3 => The local video capture device is in use
4 => The local video capture failed, it is recommended to check whether the capture device is working properly
5 => Local video encoding failed

onLocalAudioStateChanged

When the status of the local audio changes

cRtsPusher.on("onLocalAudioStateChanged",data=>{});
ParametersDescription
state0 => The default initial state of the local audio
1 => The local audio capture device started successfully
2 => The first frame of local audio is successfully encoded
3 => Local audio failed to start
error1 => The reason for the error is not clear
2 => No permission to start local audio capture device
3 => The local audio capture device is in use
4 => Local audio collection failed, it is recommended to check whether the collection device is working properly
5 => Local audio encoding failed

onError

An error occurred callback

cRtsPusher.on("onError",data=>{});
ParametersDescription
errError code, see ERROR_CODE_TYPE
msgwrong description

detail

This callback method indicates that an error (network or media related) occurred during SDK runtime. Normally, the error reported by the SDK means that the SDK cannot be automatically restored, and the app needs to intervene or prompt the user.