RtcEngineEventHandler class

The RtcEngineEventHandler interface class is used by the SDK to send event notifications to the app. The app receives SDK event notifications by inheriting the methods of this interface class.

All methods of this interface class have default (empty) implementations. The app can choose to inherit only the events of interest. In callback methods, the app should not perform time-consuming operations or call APIs that may cause blocking (such as sendMessage), otherwise it may affect the operation of the SDK. The SDK no longer catches exceptions in the custom logic implemented by developers in the RtcEngineEventHandler class callbacks. You need to handle such exceptions yourself, otherwise they may cause the app to crash.

Properties

hashCode → int
The hash code for this object.
no setterinherited
onActiveSpeaker → void Function(RtcConnection connection, int uid)?
Callback 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)?
Occurs when the volume of the audio device or app changes.
final
onAudioEffectFinished → void Function(int soundId)?
Callback when a local audio effect file finishes playing.
final
onAudioMixingFinished → void Function()?
Occurs when local music file playback ends.
final
onAudioMixingPositionChanged → void Function(int soundId)?
Reports the playback progress of the 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)?
Callback for audio publish state changes.
final
onAudioQuality → void Function(RtcConnection connection, int remoteUid, QualityType quality, int delay, int lost)?
Callback for remote audio quality.
final
onAudioRoutingChanged → void Function(int soundId)?
Callback when the audio routing changes.
final
onAudioSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
Callback for audio subscription state changes.
final
onAudioVolumeIndication → void Function(RtcConnection connection, List<AudioVolumeInfo> speakers, int speakerNumber, int totalVolume)?
Callback for user audio volume indication.
final
onCameraExposureAreaChanged → void Function(int x, int y, int width, int height)?
Callback when the camera exposure area changes.
final
onCameraFocusAreaChanged → void Function(int x, int y, int width, int height)?
Callback when the camera focus area changes.
final
onCameraReady → void Function()?
Callback when the camera is ready.
final
onChannelMediaRelayStateChanged → void Function(ChannelMediaRelayState state, ChannelMediaRelayError code)?
Callback when the state of the channel media relay changes.
final
onClientRoleChanged → void Function(RtcConnection connection, ClientRoleType oldRole, ClientRoleType newRole, ClientRoleOptions newRoleOptions)?
Callback when the user role or audience latency level is switched.
final
onClientRoleChangeFailed → void Function(RtcConnection connection, ClientRoleChangeFailedReason reason, ClientRoleType currentRole)?
Callback when user role change fails.
final
onConnectionBanned → void Function(RtcConnection connection)?
Callback when the network connection is banned by the server.
final
onConnectionInterrupted → void Function(RtcConnection connection)?
Callback when the network connection is interrupted.
final
onConnectionLost → void Function(RtcConnection connection)?
Callback when the network connection is lost and the SDK fails to reconnect to the server within 10 seconds.
final
onConnectionStateChanged → void Function(RtcConnection connection, ConnectionStateType state, ConnectionChangedReasonType reason)?
Callback when the network connection state changes.
final
onEncryptionError → void Function(RtcConnection connection, EncryptionErrorType errorType)?
Callback when an error occurs with built-in encryption.
final
onError → void Function(ErrorCodeType err, String msg)?
Callback when an error occurs.
final
onExtensionErrorWithContext → void Function(ExtensionContext context, int error, String message)?
Callback for extension errors.
final
onExtensionEventWithContext → void Function(ExtensionContext context, String key, String value)?
Plugin event callback.
final
onExtensionStartedWithContext → void Function(ExtensionContext context)?
Callback when the plugin is successfully enabled.
final
onExtensionStoppedWithContext → void Function(ExtensionContext context)?
Callback when the plugin is disabled.
final
onFacePositionChanged → void Function(int imageWidth, int imageHeight, List<Rectangle> vecRectangle, List<int> vecDistance, int numFaces)?
Reports local face detection results.
final
onFirstLocalAudioFramePublished → void Function(RtcConnection connection, int uid)?
Callback when the first local audio frame is published.
final
onFirstLocalVideoFrame → void Function(VideoSourceType source, int width, int height, int elapsed)?
Callback when the first local video frame is displayed.
final
onFirstLocalVideoFramePublished → void Function(RtcConnection connection, int uid)?
Callback when the first local video frame is published.
final
onFirstRemoteAudioDecoded → void Function(RtcConnection connection, int uid, int elapsed)?
Callback when the first remote audio frame is decoded.
final
onFirstRemoteAudioFrame → void Function(RtcConnection connection, int uid, int elapsed)?
Callback when the first remote audio frame is received.
final
onFirstRemoteVideoDecoded → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Callback when the first remote video is received and decoded.
final
onFirstRemoteVideoFrame → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Callback when the renderer receives the first remote video frame.
final
onJoinChannelSuccess → void Function(RtcConnection connection, int uid)?
Callback when successfully joined a channel.
final
onLastmileProbeResult → void Function(LastmileProbeResult result)?
Callback for the last mile uplink and downlink network quality probe report before the call.
final
onLastmileQuality → void Function(QualityType quality)?
Callback for the last mile uplink and downlink network quality report.
final
onLeaveChannel → void Function(RtcConnection connection, RtcStats stats)?
Callback when leaving a channel.
final
onLocalAudioStateChanged → void Function(RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamReason reason)?
Callback when the local audio state changes.
final
onLocalAudioStats → void Function(RtcConnection connection, LocalAudioStats stats)?
Callback with statistics of the local audio stream during a call.
final
onLocalUserRegistered → void Function(int uid, String userAccount)?
Callback when the local user successfully registers a User Account.
final
onLocalVideoEvent → void Function(VideoSourceType source, LocalVideoEventType event)?
Callback triggered when a local video event occurs.
final
onLocalVideoStateChanged → void Function(VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamReason reason)?
Callback when the local video state changes.
final
onLocalVideoStats → void Function(RtcConnection connection, LocalVideoStats stats)?
Callback with local video stream statistics.
final
onLocalVideoTranscoderError → void Function(TranscodingVideoStream stream, VideoTranscoderError error)?
Callback for local video mixing error.
final
onMultipathStats → void Function(RtcConnection connection, MultipathStats stats)?
Callback for multipath transmission statistics.
final
onNetworkQuality → void Function(RtcConnection connection, int remoteUid, QualityType txQuality, QualityType rxQuality)?
Callback for the last mile uplink and downlink network quality report for each user during the call.
final
onNetworkTypeChanged → void Function(RtcConnection connection, NetworkType type)?
Callback when the local network type changes.
final
onPermissionError → void Function(PermissionType permissionType)?
Callback when failing to obtain device permission.
final
onProxyConnected → void Function(String channel, int uid, ProxyType proxyType, String localProxyIp, int elapsed)?
Callback for proxy connection status.
final
onRejoinChannelSuccess → void Function(RtcConnection connection, int uid)?
Callback when successfully rejoined a channel.
final
onRemoteAudioStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteAudioState state, RemoteAudioStateReason reason, int elapsed)?
Callback when the remote audio stream state changes.
final
onRemoteAudioStats → void Function(RtcConnection connection, RemoteAudioStats stats)?
Callback with statistics of the remote audio stream during a call.
final
onRemoteAudioTransportStats → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Reports the statistics of the remote audio stream transmission during a call.
final
onRemoteSubscribeFallbackToAudioOnly → void Function(int uid, bool isFallbackOrRecover)?
Callback when the subscribed stream falls back to audio-only or recovers to audio and video.
final
onRemoteVideoStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteVideoState state, RemoteVideoStateReason reason, int elapsed)?
Callback when the remote video state changes.
final
onRemoteVideoStats → void Function(RtcConnection connection, RemoteVideoStats stats)?
Callback for statistics of the remote video stream during a call.
final
onRemoteVideoTransportStats → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
Callback for transport statistics of the remote video stream during a call.
final
onRequestToken → void Function(RtcConnection connection)?
Callback when the token has expired.
final
onRhythmPlayerStateChanged → void Function(RhythmPlayerStateType state, RhythmPlayerReason reason)?
Callback when the state of the virtual metronome changes.
final
onRtcStats → void Function(RtcConnection connection, RtcStats stats)?
Callback for current call statistics.
final
onRtmpStreamingEvent → void Function(String url, RtmpStreamingEvent eventCode)?
Callback for RTMP streaming events.
final
onRtmpStreamingStateChanged → void Function(String url, RtmpStreamPublishState state, RtmpStreamPublishReason reason)?
Callback when the RTMP streaming state changes.
final
onSnapshotTaken → void Function(RtcConnection connection, int uid, String filePath, int width, int height, int errCode)?
Callback for video snapshot result.
final
onStreamMessage → void Function(RtcConnection connection, int remoteUid, int streamId, Uint8List data, int length, int sentTs)?
Occurs when a stream message is received from a remote user.
final
onStreamMessageError → void Function(RtcConnection connection, int remoteUid, int streamId, ErrorCodeType code, int missed, int cached)?
Occurs when an error occurs in receiving a stream message from a remote user.
final
onTokenPrivilegeWillExpire → void Function(RtcConnection connection, String token)?
Callback when the token is about to expire in 30 seconds.
final
onTranscodedStreamLayoutInfo → void Function(RtcConnection connection, int uid, int width, int height, int layoutCount, List<VideoLayout> layoutlist)?
Callback for received mixed stream with layout information.
final
onTranscodingUpdated → void Function()?
Callback when the RTMP transcoding settings are updated.
final
onUplinkNetworkInfoUpdated → void Function(UplinkNetworkInfo info)?
Callback for uplink network information changes.
final
onUserEnableLocalVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Callback when a remote user enables/disables local video capture.
final
onUserEnableVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Callback when a remote user enables/disables the video module.
final
onUserInfoUpdated → void Function(int uid, UserInfo info)?
Callback when remote user information is updated.
final
onUserJoined → void Function(RtcConnection connection, int uid, int elapsed)?
Callback when a remote user (in communication) or host (in live streaming) joins the current channel.
final
onUserMuteAudio → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Occurs when a remote user (in communication) or host (in live streaming) stops or resumes sending audio stream.
final
onUserMuteVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
Callback when a remote user stops or resumes publishing the video stream.
final
onUserOffline → void Function(RtcConnection connection, int remoteUid, UserOfflineReasonType reason)?
Callback when a remote user (in communication) or host (in live streaming) leaves the current channel.
final
onVideoDeviceStateChanged → void Function(String deviceId, MediaDeviceType deviceType, MediaDeviceStateType deviceState)?
Callback when a video device changes.
final
onVideoPublishStateChanged → void Function(VideoSourceType source, String channel, StreamPublishState oldState, StreamPublishState newState, int elapseSinceLastState)?
Callback for video publishing state change.
final
onVideoRenderingTracingResult → void Function(RtcConnection connection, int uid, MediaTraceEvent currentEvent, VideoRenderingTracingInfo tracingInfo)?
Callback for video frame rendering events.
final
onVideoSizeChanged → void Function(RtcConnection connection, VideoSourceType sourceType, int uid, int width, int height, int rotation)?
Callback when the size and rotation of local or remote video changes.
final
onVideoStopped → void Function()?
Callback when video function is stopped.
final
onVideoSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
Callback for video subscription 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