Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RtcChannelEvents

The RtcChannelEvents interface.

Hierarchy

  • RtcChannelEvents

Index

Events

ActiveSpeaker

ActiveSpeaker: UidCallback

Occurs when the most active remote speaker is detected.

This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling enableAudioVolumeIndication, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK.

Note

  • To receive this callback, you need to call enableAudioVolumeIndication.
  • This callback reports the ID of the user with the highest voice volume during a period of time, instead of at the moment.

AudioPublishStateChanged

AudioPublishStateChanged: StreamPublishStateCallback

Occurs when the audio publishing state changes.

since

v3.1.2.

This callback indicates the publishing state change of the local audio stream.

AudioSubscribeStateChanged

AudioSubscribeStateChanged: StreamSubscribeStateCallback

Occurs when the audio subscribing state changes.

since

v3.1.2.

This callback indicates the subscribing state change of a remote audio stream.

ChannelMediaRelayEvent

ChannelMediaRelayEvent: MediaRelayEventCallback

Reports events during the media stream relay.

ChannelMediaRelayStateChanged

ChannelMediaRelayStateChanged: MediaRelayStateCallback

Occurs when the state of the media stream relay changes.

The SDK reports the state of the current media relay and possible error messages in this callback.

ClientRoleChangeFailed

ClientRoleChangeFailed: ClientRoleChangeCallback

Occurs when the user role switch fails in the interactive live streaming.

since

v3.7.0

In the LiveBroadcasting channel profile, when the local user calls setClientRole to switch their user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.

ClientRoleChanged

ClientRoleChanged: ClientRoleCallback

Occurs when the user role switches successfully in the interactive live streaming.

In the LiveBroadcasting channel profile, when the local user successfully calls setClientRole to switch their user role after joining the channel, for example, from a host to an audience member or vice versa, the SDK triggers this callback to report the user role before and after the switch.

ConnectionLost

ConnectionLost: EmptyCallback

Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.

The SDK also triggers this callback when it cannot connect to the server 10 seconds after calling joinChannel, regardless of whether it is in the channel or not.

If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.

ConnectionStateChanged

ConnectionStateChanged: ConnectionStateCallback

Occurs when the network connection state changes.

The Agora SDK triggers this callback to report on the current network connection state when it changes, and the reason to such change.

Error

Reports the error code of the RtcChannel instance.

FirstRemoteVideoFrame

FirstRemoteVideoFrame: VideoFrameWithUidCallback

Occurs when the first remote video frame is rendered.

since

v3.7.0

This callback is triggered after the first frame of the remote video is rendered on the video window. The application can retrieve the data of the time elapsed from the user joining the channel until the first video frame is displayed.

JoinChannelSuccess

Occurs when the local user joins a specified channel.

If the uid is not specified when calling joinChannel, the server automatically assigns a uid.

LeaveChannel

LeaveChannel: RtcStatsCallback

Occurs when a user leaves the channel.

When a user leaves the channel by using the leaveChannel method, the SDK uses this callback to notify the app when the user leaves the channel.

With this callback, the app retrieves the channel information, such as the call duration and statistics.

LocalPublishFallbackToAudioOnly

LocalPublishFallbackToAudioOnly: FallbackCallback

Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.

If you call setLocalPublishFallbackOption and set option as AudioOnly, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves.

MetadataReceived

MetadataReceived: MetadataCallback

Occurs when the local user receives the metadata.

NetworkQuality

Reports the last mile network quality of each user in the channel once every two seconds.

Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times.

Note txQuality is Unknown when the user is not sending a stream; rxQuality is Unknown when the user is not receiving a stream.

ProxyConnected

ProxyConnected: ProxyConnectedCallback

Reports the proxy connection state.

since

v3.6.2

You can use this callback to listen for the state of the SDK connecting to a proxy. For example, when a user calls setCloudProxy and joins a channel successfully, the SDK triggers this callback to report the user ID, the proxy type connected, and the time elapsed from the user calling joinChannel until this callback is triggered.

RejoinChannelSuccess

RejoinChannelSuccess: UidWithElapsedAndChannelCallback

Occurs when a user rejoins the channel after being disconnected due to network problems.

When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.

RemoteAudioStateChanged

RemoteAudioStateChanged: RemoteAudioStateCallback

Occurs when the remote audio state changes.

This callback indicates the state change of the remote audio stream.

RemoteAudioStats

RemoteAudioStats: RemoteAudioStatsCallback

Reports the statistics of the audio stream from each remote user/host.

The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.

Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high.

RemoteSubscribeFallbackToAudioOnly

RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback

Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve.

If you call setRemoteSubscribeFallbackOption and set option as AudioOnly, this callback is triggered when the remote media stream falls back to audio-only mode due to poor downlink conditions, or when the remote media stream switches back to the video after the downlink network condition improves.

Note

Once the remote media stream is switched to the low stream due to poor network conditions, you can monitor the stream switch between a high and low stream in the RemoteVideoStats callback.

RemoteVideoStateChanged

RemoteVideoStateChanged: RemoteVideoStateCallback

Occurs when the remote video state changes.

RemoteVideoStats

RemoteVideoStats: RemoteVideoStatsCallback

Reports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times.

RequestToken

RequestToken: EmptyCallback

Occurs when the token has expired.

After a token is specified when joining the channel, the token expires after a certain period of time, and a new token is required to reconnect to the server. This callback notifies the app to generate a new token and call renewToken to renew the token.

RtcStats

Reports the statistics of the RtcEngine once every two seconds.

RtmpStreamingEvent

RtmpStreamingEvent: RtmpStreamingEventCallback

Reports events during the RTMP or RTMPS streaming.

since

v3.1.2.

RtmpStreamingStateChanged

RtmpStreamingStateChanged: RtmpStreamingStateCallback

Occurs when the state of the RTMP or RTMPS streaming changes.

When the CDN live streaming state changes, the SDK triggers this callback to report the current state and the reason why the state has changed.

This callback indicates the state of the RTMP or RTMPS streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter.

StreamMessage

StreamMessage: StreamMessageCallback

Occurs when the local user receives a remote data stream.

The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the sendStreamMessage method.

StreamMessageError

StreamMessageError: StreamMessageErrorCallback

Occurs when the local user fails to receive a remote data stream.

The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the sendStreamMessage method.

TokenPrivilegeWillExpire

TokenPrivilegeWillExpire: TokenCallback

Occurs when the token expires in 30 seconds.

The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires, to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call renewToken to pass the new token to the SDK.

TranscodingUpdated

TranscodingUpdated: EmptyCallback

Occurs when the publisher's transcoding settings are updated.

When the LiveTranscoding class in the setLiveTranscoding method updates, the SDK triggers this callback to report the update information.

Note

If you call setLiveTranscoding to set the LiveTranscoding class for the first time, the SDK does not trigger this callback.

UserJoined

Occurs when a remote user (Communication) or a host (LiveBroadcasting) joins the channel.

  • Communication profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users.
  • LiveBroadcasting profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel.

The SDK triggers this callback under one of the following circumstances:

  • A remote user/host joins the channel by calling joinChannel.
  • A remote user switches the user role to the host by calling setClientRole after joining the channel.
  • A remote user/host rejoins the channel after a network interruption.

Note

  • In the LiveBroadcasting profile:
  • The host receives this callback when another host joins the channel.
  • The audience in the channel receives this callback when a new host joins the channel.
  • When a web app joins the channel, this callback is triggered as long as the web app publishes streams.

UserOffline

UserOffline: UserOfflineCallback

Occurs when a remote user (Communication) or a host (LiveBroadcasting) leaves the channel.

There are two reasons for users to become offline:

  • Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel.
  • Go offline: When no data packet of the user or host is received for a certain period of time (around 20 seconds), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection.

UserSuperResolutionEnabled

UserSuperResolutionEnabled: UserSuperResolutionEnabledCallback

Reports whether the super resolution feature is successfully enabled. (beta feature)

since

v3.5.2

After calling enableRemoteSuperResolution, the SDK triggers this callback to report whether super resolution is successfully enabled. If it is not successfully enabled, use reason for troubleshooting.

VideoPublishStateChanged

VideoPublishStateChanged: StreamPublishStateCallback

Occurs when the video publishing state changes.

since

v3.1.2.

This callback indicates the publishing state change of the local video stream.

VideoSizeChanged

VideoSizeChanged: VideoSizeCallback

Occurs when the video size or rotation information of a remote user changes.

VideoSubscribeStateChanged

VideoSubscribeStateChanged: StreamSubscribeStateCallback

Occurs when the video subscribing state changes.

since

v3.1.2.

This callback indicates the subscribing state change of a remote video stream.

Warning

Reports the warning code of the RtcChannel instance.

Generated using TypeDoc