CloudHub Docs
Download Documents

RTS


CloudHubRTS Electron

onPushstateupdated

Occurs when the push status changes

rtsPusher.onEvent("onPushstateupdated",data=>{});
ParameterDescription
sourceIdSourceID : string
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

onRtsstats

Occurs when statistics change

rtsPusher.onEvent("onRtsstats",data=>{});
ParameterDescription
sourceIdSourceID : string
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 (%).

onError

An error occurred callback

rtsPusher.onEvent("onError",data=>{});

Parameter

ParameterDescription
errError code
msgError message

Details

In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.