RtcChannelEventHandler class

The SDK uses RtcChannelEventHandler to send RtcChannel event notifications to your app.

Constructors

RtcChannelEventHandler({WarningCallback? warning, ErrorCallback? error, UidWithElapsedAndChannelCallback? joinChannelSuccess, UidWithElapsedAndChannelCallback? rejoinChannelSuccess, RtcStatsCallback? leaveChannel, ClientRoleCallback? clientRoleChanged, UidWithElapsedCallback? userJoined, UserOfflineCallback? userOffline, ConnectionStateCallback? connectionStateChanged, EmptyCallback? connectionLost, TokenCallback? tokenPrivilegeWillExpire, EmptyCallback? requestToken, UidCallback? activeSpeaker, VideoSizeCallback? videoSizeChanged, RemoteVideoStateCallback? remoteVideoStateChanged, RemoteAudioStateCallback? remoteAudioStateChanged, FallbackCallback? localPublishFallbackToAudioOnly, FallbackWithUidCallback? remoteSubscribeFallbackToAudioOnly, RtcStatsCallback? rtcStats, NetworkQualityWithUidCallback? networkQuality, RemoteVideoStatsCallback? remoteVideoStats, RemoteAudioStatsCallback? remoteAudioStats, RtmpStreamingStateCallback? rtmpStreamingStateChanged, EmptyCallback? transcodingUpdated, StreamInjectedStatusCallback? streamInjectedStatus, StreamMessageCallback? streamMessage, StreamMessageErrorCallback? streamMessageError, MediaRelayStateCallback? channelMediaRelayStateChanged, MediaRelayEventCallback? channelMediaRelayEvent, MetadataCallback? metadataReceived, StreamPublishStateCallback? audioPublishStateChanged, StreamPublishStateCallback? videoPublishStateChanged, StreamSubscribeStateCallback? audioSubscribeStateChanged, StreamSubscribeStateCallback? videoSubscribeStateChanged, RtmpStreamingEventCallback? rtmpStreamingEvent, UserSuperResolutionEnabledCallback? userSuperResolutionEnabled, OnClientRoleChangeFailed? clientRoleChangeFailed, OnFirstRemoteVideoFrame? firstRemoteVideoFrame})
Constructs the RtcChannelEventHandler.

Properties

activeSpeaker UidCallback?
Occurs when the most active speaker is detected. After a successful call of enableAudioVolumeIndication , the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user, who is detected as the loudest for the most times, is the most active user. When the number of users exceeds two (included) and an active speaker is detected, the SDK triggers this callback and reports the uid of the most active speaker. If the most active speaker remains the same, the SDK triggers the activeSpeaker callback only once. If the most active speaker changes to another user, the SDK triggers this callback again and reports the uid of the new active speaker.
getter/setter pair
audioPublishStateChanged StreamPublishStateCallback?
Occurs when the audio publishing state changes.
getter/setter pair
audioSubscribeStateChanged StreamSubscribeStateCallback?
Occurs when the audio subscribing state changes.
getter/setter pair
channelMediaRelayEvent MediaRelayEventCallback?
Reports events during the media stream relay.
getter/setter pair
channelMediaRelayStateChanged MediaRelayStateCallback?
Occurs when the state of the media stream relay changes. The SDK returns the state of the current media relay with any error message.
getter/setter pair
clientRoleChanged ClientRoleCallback?
Occurs when the user role switches successfully in the interactive live streaming. In the LIVE_BROADCASTING 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.
getter/setter pair
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 triggers this callback when it cannot connect to the server 10 seconds after calling the joinChannel method, regardless of whether it is in the channel.
getter/setter pair
connectionStateChanged ConnectionStateCallback?
Occurs when the network connection state changes. When the network connection state changes, the SDK triggers this callback and reports the current connection state and the reason for the change.
getter/setter pair
error ErrorCallback?
The error code RtcChannel reported.
getter/setter pair
firstRemoteVideoFrame OnFirstRemoteVideoFrame?
Occurs when the first remote video frame is rendered. The SDK triggers this callback when the first local video frame is displayed/rendered on the local video view. The application can retrieve the time elapsed (the elapsed parameter) from a user joining the channel until the first video frame is displayed.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
joinChannelSuccess UidWithElapsedAndChannelCallback?
Occurs when a user joins a channel. This callback notifies the application that a user joins a specified channel.
getter/setter pair
leaveChannel RtcStatsCallback?
Occurs when a user leaves a 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 gets the channel information, such as the call duration and quality statistics.
getter/setter pair
localPublishFallbackToAudioOnly FallbackCallback?
Occurs when the published media stream falls back to an audio-only stream. If you call setLocalPublishFallbackOption and set option as AudioOnly, the SDK triggers this callback when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. If the local stream falls back to the audio-only stream, the remote user receives the userMuteVideo callback.
getter/setter pair
metadataReceived MetadataCallback?
Occurs when the local user receives Metadata .
getter/setter pair
networkQuality NetworkQualityWithUidCallback?
Reports the last mile network quality of each user in the channel. This callback reports the last mile network conditions of each user in the channel. Last mile refers to the connection between the local device and Agora's edge server. The SDK triggers this callback once every two seconds. If a channel includes multiple users, the SDK triggers this callback as many times.
getter/setter pair
rejoinChannelSuccess UidWithElapsedAndChannelCallback?
Occurs when a user rejoins the channel. When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection.
getter/setter pair
remoteAudioStateChanged RemoteAudioStateCallback?
Occurs when the remote audio state changes. When the audio state of a remote user (in the voice/video call channel) or host (in the live streaming channel) changes, the SDK triggers this callback to report the current state of the remote audio stream. This callback does not work properly when the number of users (in the voice/video call channel) or hosts (in the live streaming channel) in the channel exceeds 17.
getter/setter pair
remoteAudioStats RemoteAudioStatsCallback?
Reports the transport-layer statistics of each remote audio stream. The SDK triggers this callback once every two seconds for each remote user who is sending audio streams. If a channel includes multiple remote users, the SDK triggers this callback as many times.
getter/setter pair
remoteSubscribeFallbackToAudioOnly FallbackWithUidCallback?
Occurs when the remote media stream falls back to the audio-only stream due to poor network conditions or switches back to the video stream after the network conditions improve. If you call setRemoteSubscribeFallbackOption and set option as AudioOnly, the SDK triggers this callback 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. Once the remote media stream switches to the low-quality stream due to poor network conditions, you can monitor the stream switch between a high-quality and low-quality stream in the remoteVideoStats callback.
getter/setter pair
remoteVideoStateChanged RemoteVideoStateCallback?
Occurs when the remote video state changes. This callback does not work properly when the number of users (in the voice/video call channel) or hosts (in the live streaming channel) in the channel exceeds 17.
getter/setter pair
remoteVideoStats RemoteVideoStatsCallback?
Reports the transport-layer statistics of each remote video stream. Reports the statistics of the video stream from the remote users. The SDK triggers this callback once every two seconds for each remote user. If a channel has multiple users/hosts sending video streams, the SDK triggers this callback as many times.
getter/setter pair
requestToken EmptyCallback?
Occurs when the token expires. When the token expires during a call, the SDK triggers this callback to remind the app to renew the token. Once you receive this callback, generate a new token on your app server, and call joinChannel to rejoin the channel.
getter/setter pair
rtcStats RtcStatsCallback?
Reports the statistics of the current call. The SDK triggers this callback once every two seconds after the user joins the channel.
getter/setter pair
rtmpStreamingEvent RtmpStreamingEventCallback?
Reports events during the media push.
getter/setter pair
rtmpStreamingStateChanged RtmpStreamingStateCallback?
Occurs when the media push state 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. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the error code parameter.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamInjectedStatus StreamInjectedStatusCallback?
Occurs when a media stream URL address is added to the interactive live streaming.
getter/setter pair
streamMessage StreamMessageCallback?
Occurs when the local user receives the data stream from the remote user. The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the sendStreamMessage method.
getter/setter pair
streamMessageError StreamMessageErrorCallback?
Occurs when the local user does not receive the data stream from the remote user. 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.
getter/setter pair
tokenPrivilegeWillExpire TokenCallback?
Occurs when the token expires in 30 seconds. When the token is about to expire in 30 seconds, the SDK triggers this callback to remind the app to renew the token. Upon receiving this callback, generate a new token on your server, and call renewToken to pass the new token to the SDK.
getter/setter pair
transcodingUpdated EmptyCallback?
Occurs when the publisher's transcoding is updated. If you call the setLiveTranscoding method to set the LiveTranscoding class for the first time, the SDK does not trigger this callback. When the LiveTranscoding class in the setLiveTranscoding method updates, the SDK triggers the transcodingUpdated callback to report the update information.
getter/setter pair
userJoined UidWithElapsedCallback?
Occurs when a remote user (COMMUNICATION)/ host (LIVE_BROADCASTING) joins the channel. In a communication channel, this callback indicates that a remote user joins the channel. The SDK also triggers this callback to report the existing users in the channel when a user joins the channel. In a live-broadcast channel, this callback indicates that a host joins the channel. The SDK also triggers this callback to report the existing hosts in the channel when a host joins the channel. Agora recommends limiting the number of hosts to 17. The SDK triggers this callback under one of the following circumstances: A remote user/host joins the channel by calling the joinChannel method. A remote user switches the user role to the host after joining the channel. A remote user/host rejoins the channel after a network interruption. The host injects an online media stream into the channel by calling the addInjectStreamUrl method.
getter/setter pair
userOffline UserOfflineCallback?
Occurs when a remote user (COMMUNICATION)/ host (LIVE_BROADCASTING) leaves the channel. There are two reasons for users to become offline: Leave the channel: When a 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. Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the communication profile, and more for the live broadcast profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections. It's recommended to use the Agora RTM SDK for reliable offline detection.
getter/setter pair
userSuperResolutionEnabled UserSuperResolutionEnabledCallback?
Reports whether the super resolution feature is successfully enabled. After calling enableRemoteSuperResolution , the SDK triggers the callback to report whether super resolution is successfully enabled. If it is not successfully enabled, use reason for troubleshooting.
getter/setter pair
videoPublishStateChanged StreamPublishStateCallback?
Occurs when the video publishing state changes.
getter/setter pair
videoSizeChanged VideoSizeCallback?
Occurs when the video size or rotation of a specified user changes.
getter/setter pair
videoSubscribeStateChanged StreamSubscribeStateCallback?
Occurs when the video subscribing state changes.
getter/setter pair
warning WarningCallback?
Reports the warning code of RtcChannel .
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited