Skip to main content
RTCClientEvent carries the channel control events of one channel. The first listener must be passed through RTCEngine.join(..., clientEvent, ...); after the join succeeds, you can replace or unbind it with RTCChannel.setRtcClientEvent(...). If you only care about a few events, extend RTCClientSimpleEvent, which provides empty implementations.

Join results

onJoinSucceed(channel, uid, whiteBoard)

You joined the channel successfully. channel is the channel ID, uid is the current user ID, and whiteBoard is the nullable whiteboard URL or info. Treat this callback as the signal that the join actually succeeded.

onJoinFailed(channel, statusCode)

You failed to join the channel. channel has a value when the channel ID can be parsed from the token, otherwise it’s null; for statusCode, see Error codes.

User events

onUserUpdate(channel, uid)

Your own user info was updated.

onMeMembershipChanged(channel, isMember)

Your role changed between audience and full member. isMember = true means you were promoted to a full member, and false means you were demoted to audience; read your initial role at join time with isAudience() on the corresponding channel.

onRemoteUserJoin(channel, uid)

A remote user joined the channel.

onRemoteUserLeave(channel, userInfo, leaveReason)

A remote user left the channel. userInfo is the last snapshot of the leaving user’s info.

onRemoteUserUpdate(channel, uid)

A remote user’s info was updated.

Track and channel events

onStreamTrackAdd(uid, channel, trackId, trackDesc)

A remote track was added. Use the RTCChannel of the same channel to get and subscribe to the remote track.

onStreamTrackUpdate(uid, channel, trackId, trackDesc)

A remote track’s info was updated.

onStreamTrackRemove(uid, channel, trackInfo)

A remote track was removed. For TrackInfo fields, see Types.

onChannelUpdate(channel, props)

Channel properties were updated; props may be null.

onCustomMessage(channel, uid, sid, name, action, content)

An in-channel custom message was received. channel is the channel the message belongs to; the other parameters are, in order, the sender’s user ID, session ID, name, action identifier, and message content.

Connection events

onDisconnected(channel, leaveReason, statusCode, message)

An unrecoverable disconnect occurred in the channel. You need to call join(...) again for this channel; other channels aren’t affected.

onReconnected(channel)

The channel reconnected successfully after a disconnect.

onReconnecting(channel)

The channel connection dropped and automatic reconnection started. :::note The former RTCClientEvent.onError(...) has been removed. Engine-blocking operations and global errors are all reported by RTCEngineEvent.onError(...). :::