RtcEngineEventHandler class

The SDK uses the RtcEngineEventHandler interface to send event notifications to your app. Your app can get those notifications through methods that inherit this interface.

All methods in this interface have default (empty) implementation. You can choose to inherit events related to your app scenario. In the callbacks, avoid implementing time-consuming tasks or calling APIs that may cause thread blocking (such as sendMessage). Otherwise, the SDK may not work properly. The SDK no longer catches exceptions in the code logic that developers implement themselves in RtcEngineEventHandler class. You need to handle this exception yourself, otherwise the app may crash when the exception occurs.

Properties

hashCode int
The hash code for this object.
no setterinherited
onActiveSpeaker → void Function(RtcConnection connection, int uid)?
Occurs when the most active remote speaker is detected.
final
onAudioDeviceStateChanged → void Function(String deviceId, MediaDeviceType deviceType, MediaDeviceStateType deviceState)?
Occurs when the audio device state changes.
final
onAudioDeviceVolumeChanged → void Function(MediaDeviceType deviceType, int volume, bool muted)?
Reports the volume change of the audio device or app.
final
onAudioEffectFinished → void Function(int soundId)?
Occurs when the playback of the local music file finishes.
final
onAudioMixingFinished → void Function()?
Occurs when the playback of the local music file finishes.
final
onAudioMixingPositionChanged → void Function(int position)?
Reports the playback progress of a music file.
final
onAudioMixingStateChanged → void Function(AudioMixingStateType state, AudioMixingReasonType reason)?
Occurs when the playback state of the music file changes.
final
onAudioPublishStateChanged → void Function(String channel, StreamPublishState oldState, StreamPublishState newState, int elapseSinceLastState)?
Occurs when the audio publishing state changes.
final
onAudioQuality → void Function(RtcConnection connection, int remoteUid, QualityType quality, int delay, int lost)?
Reports the statistics of the audio stream sent by each remote user.
final
onAudioRoutingChanged → void Function(int routing)?
Occurs when the local audio route changes.
final
onAudioSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
Occurs when the audio subscribing state changes.
final
onAudioVolumeIndication → void Function(RtcConnection connection, List<AudioVolumeInfo> speakers, int speakerNumber, int totalVolume)?
Reports the volume information of users.
final
onCameraExposureAreaChanged → void Function(int x, int y, int width, int height)?
Occurs when the camera exposure area changes.
final
onCameraFocusAreaChanged → void Function(int x, int y, int width, int height)?
Occurs when the camera focus area changes.
final
onCameraReady → void Function()?
Occurs when the camera turns on and is ready to capture the video.
final
onChannelMediaRelayStateChanged → void Function(ChannelMediaRelayState state, ChannelMediaRelayError code)?
Occurs when the state of the media stream relay changes.
final
onClientRoleChanged → void Function(RtcConnection connection, ClientRoleType oldRole, ClientRoleType newRole, ClientRoleOptions newRoleOptions)?
Occurs when the user role or the audience latency level changes.
final
onClientRoleChangeFailed → void Function(RtcConnection connection, ClientRoleChangeFailedReason reason, ClientRoleType currentRole)?
Occurs when switching a user role fails.
final
onConnectionBanned → void Function(RtcConnection connection)?
Occurs when the connection is banned by the Agora server.
final
onConnectionInterrupted → void Function(RtcConnection connection)?
Occurs when the connection between the SDK and the server is interrupted.
final
onConnectionLost → void Function(RtcConnection connection)?
Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.
final
onConnectionStateChanged → void Function(RtcConnection connection, ConnectionStateType state, ConnectionChangedReasonType reason)?
Occurs when the network connection state changes.
final
onEncryptionError → void Function(RtcConnection connection, EncryptionErrorType errorType)?
Reports the built-in encryption errors.
final
onError → void Function(ErrorCodeType err, String msg)?
Reports an error during SDK runtime.
final
onExtensionErrorWithContext → void Function(ExtensionContext context, int error, String message)?
Occurs when the extension runs incorrectly.
final
onExtensionEventWithContext → void Function(ExtensionContext context, String key, String value)?
The event callback of the extension.
final
onExtensionStartedWithContext → void Function(ExtensionContext context)?
Occurrs when the extension is enabled.
final
onExtensionStoppedWithContext → void Function(ExtensionContext context)?
Occurs when the extension is disabled.
final
onFacePositionChanged → void Function(int imageWidth, int imageHeight, List<Rectangle> vecRectangle, List<int> vecDistance, int numFaces)?
Reports the face detection result of the local user.
final
onFirstLocalAudioFramePublished → void Function(RtcConnection connection, int elapsed)?
Occurs when the first audio frame is published.
final
onFirstLocalVideoFrame → void Function(VideoSourceType source, int width, int height, int elapsed)?
Occurs when the first local video frame is displayed on the local video view.
final
onFirstLocalVideoFramePublished → void Function(RtcConnection connection, int elapsed)?
Occurs when the first video frame is published.
final
onFirstRemoteAudioDecoded → void Function(RtcConnection connection, int uid, int elapsed)?
Occurs when the SDK decodes the first remote audio frame for playback.
final
onFirstRemoteAudioFrame → void Function(RtcConnection connection, int userId, int elapsed)?
Occurs when the SDK receives the first audio frame from a specific remote user.
final
onFirstRemoteVideoDecoded → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Occurs when the first remote video frame is received and decoded.
final
onFirstRemoteVideoFrame → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Occurs when the renderer receives the first frame of the remote video.
final
onJoinChannelSuccess → void Function(RtcConnection connection, int elapsed)?
Occurs when a user joins a channel.
final
onLastmileProbeResult → void Function(LastmileProbeResult result)?
Reports the last mile network probe result.
final
onLastmileQuality → void Function(QualityType quality)?
Reports the last-mile network quality of the local user.
final
onLeaveChannel → void Function(RtcConnection connection, RtcStats stats)?
Occurs when a user leaves a channel.
final
onLocalAudioStateChanged → void Function(RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamReason reason)?
Occurs when the local audio stream state changes.
final
onLocalAudioStats → void Function(RtcConnection connection, LocalAudioStats stats)?
Reports the statistics of the local audio stream.
final
onLocalUserRegistered → void Function(int uid, String userAccount)?
Occurs when the local user registers a user account.
final
onLocalVideoStateChanged → void Function(VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamReason reason)?
Occurs when the local video stream state changes.
final
onLocalVideoStats → void Function(RtcConnection connection, LocalVideoStats stats)?
Reports the statistics of the local video stream.
final
onLocalVideoTranscoderError → void Function(TranscodingVideoStream stream, VideoTranscoderError error)?
Occurs when there's an error during the local video mixing.
final
onNetworkQuality → void Function(RtcConnection connection, int remoteUid, QualityType txQuality, QualityType rxQuality)?
Reports the last mile network quality of each user in the channel.
final
onNetworkTypeChanged → void Function(RtcConnection connection, NetworkType type)?
Occurs when the local network type changes.
final
onPermissionError → void Function(PermissionType permissionType)?
Occurs when the SDK cannot get the device permission.
final
onProxyConnected → void Function(String channel, int uid, ProxyType proxyType, String localProxyIp, int elapsed)?
Reports the proxy connection state.
final
onRejoinChannelSuccess → void Function(RtcConnection connection, int elapsed)?
Occurs when a user rejoins the channel.
final
onRemoteAudioStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteAudioState state, RemoteAudioStateReason reason, int elapsed)?
Occurs when the remote audio state changes.
final
onRemoteAudioStats → void Function(RtcConnection connection, RemoteAudioStats stats)?
Reports the transport-layer statistics of each remote audio stream.
final
onRemoteAudioTransportStats → void Function(RtcConnection connection, int remoteUid, int delay, int lost, int rxKBitRate)?
Reports the transport-layer statistics of each remote audio stream.
final
onRemoteSubscribeFallbackToAudioOnly → void Function(int uid, bool isFallbackOrRecover)?
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.
final
onRemoteVideoStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteVideoState state, RemoteVideoStateReason reason, int elapsed)?
Occurs when the remote video stream state changes.
final
onRemoteVideoStats → void Function(RtcConnection connection, RemoteVideoStats stats)?
Reports the statistics of the video stream sent by each remote users.
final
onRemoteVideoTransportStats → void Function(RtcConnection connection, int remoteUid, int delay, int lost, int rxKBitRate)?
Reports the transport-layer statistics of each remote video stream.
final
onRequestToken → void Function(RtcConnection connection)?
Occurs when the token expires.
final
onRhythmPlayerStateChanged → void Function(RhythmPlayerStateType state, RhythmPlayerReason reason)?
Occurs when the state of virtual metronome changes.
final
onRtcStats → void Function(RtcConnection connection, RtcStats stats)?
Reports the statistics about the current call.
final
onRtmpStreamingEvent → void Function(String url, RtmpStreamingEvent eventCode)?
Reports events during the Media Push.
final
onRtmpStreamingStateChanged → void Function(String url, RtmpStreamPublishState state, RtmpStreamPublishReason reason)?
Occurs when the state of Media Push changes.
final
onSnapshotTaken → void Function(RtcConnection connection, int uid, String filePath, int width, int height, int errCode)?
Reports the result of taking a video snapshot.
final
onStreamMessage → void Function(RtcConnection connection, int remoteUid, int streamId, Uint8List data, int length, int sentTs)?
Occurs when the local user receives the data stream from the remote user.
final
onStreamMessageError → void Function(RtcConnection connection, int remoteUid, int streamId, ErrorCodeType code, int missed, int cached)?
Occurs when the local user does not receive the data stream from the remote user.
final
onTokenPrivilegeWillExpire → void Function(RtcConnection connection, String token)?
Occurs when the token expires in 30 seconds.
final
onTranscodedStreamLayoutInfo → void Function(RtcConnection connection, int uid, int width, int height, int layoutCount, List<VideoLayout> layoutlist)?
Occurs when the local user receives a mixed video stream carrying layout information.
final
onTranscodingUpdated → void Function()?
Occurs when the publisher's transcoding is updated.
final
onUplinkNetworkInfoUpdated → void Function(UplinkNetworkInfo info)?
Occurs when the uplink network information changes.
final
onUserEnableLocalVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Occurs when a specific remote user enables/disables the local video capturing function.
final
onUserEnableVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Occurs when a remote user enables or disables the video module.
final
onUserInfoUpdated → void Function(int uid, UserInfo info)?
Occurs when the SDK gets the user ID and user account of the remote user.
final
onUserJoined → void Function(RtcConnection connection, int remoteUid, int elapsed)?
Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel.
final
onUserMuteAudio → void Function(RtcConnection connection, int remoteUid, bool muted)?
Occurs when a remote user (in the communication profile) or a host (in the live streaming profile) stops/resumes sending the audio stream.
final
onUserMuteVideo → void Function(RtcConnection connection, int remoteUid, bool muted)?
Occurs when a remote user stops or resumes publishing the video stream.
final
onUserOffline → void Function(RtcConnection connection, int remoteUid, UserOfflineReasonType reason)?
Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.
final
onVideoDeviceStateChanged → void Function(String deviceId, MediaDeviceType deviceType, MediaDeviceStateType deviceState)?
Occurs when the video device state changes.
final
onVideoPublishStateChanged → void Function(VideoSourceType source, String channel, StreamPublishState oldState, StreamPublishState newState, int elapseSinceLastState)?
Occurs when the video publishing state changes.
final
onVideoRenderingTracingResult → void Function(RtcConnection connection, int uid, MediaTraceEvent currentEvent, VideoRenderingTracingInfo tracingInfo)?
Video frame rendering event callback.
final
onVideoSizeChanged → void Function(RtcConnection connection, VideoSourceType sourceType, int uid, int width, int height, int rotation)?
Occurs when the video size or rotation of a specified user changes.
final
onVideoStopped → void Function()?
Occurs when the video stops playing.
final
onVideoSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
Occurs when the video subscribing state changes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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