RtcEngineEventHandler class

The SDK uses the RtcEngineEventHandler class to send callbacks to the application, and the application inherits the methods of this class to retrieve these callbacks.

All methods in this class have their (empty) default implementations, and the application can inherit only some of the required events instead of all of them.

In the callbacks, the application should avoid time-consuming tasks or call blocking APIs (such as SendMessage), otherwise, the SDK may not work properly.

Constructors

RtcEngineEventHandler({WarningCallback? warning, ErrorCallback? error, ApiCallCallback? apiCallExecuted, UidWithElapsedAndChannelCallback? joinChannelSuccess, RtcStatsCallback? rejoinChannelSuccess, RtcStatsCallback? leaveChannel, UserAccountCallback? localUserRegistered, UserInfoCallback? userInfoUpdated, ClientRoleCallback? clientRoleChanged, UidWithElapsedCallback? userJoined, UserOfflineCallback? userOffline, ConnectionStateCallback? connectionStateChanged, NetworkTypeCallback? networkTypeChanged, EmptyCallback? connectionLost, TokenCallback? tokenPrivilegeWillExpire, EmptyCallback? requestToken, AudioVolumeCallback? audioVolumeIndication, UidCallback? activeSpeaker, ElapsedCallback? firstLocalAudioFrame, VideoFrameCallback? firstLocalVideoFrame, UidWithMutedCallback? userMuteVideo, VideoSizeCallback? videoSizeChanged, RemoteVideoStateCallback? remoteVideoStateChanged, LocalVideoStateCallback? localVideoStateChanged, RemoteAudioStateCallback? remoteAudioStateChanged, LocalAudioStateCallback? localAudioStateChanged, FallbackCallback? localPublishFallbackToAudioOnly, FallbackWithUidCallback? remoteSubscribeFallbackToAudioOnly, AudioRouteCallback? audioRouteChanged, RectCallback? cameraFocusAreaChanged, RectCallback? cameraExposureAreaChanged, FacePositionCallback? facePositionChanged, RtcStatsCallback? rtcStats, NetworkQualityCallback? lastmileQuality, NetworkQualityWithUidCallback? networkQuality, LastmileProbeCallback? lastmileProbeResult, LocalVideoStatsCallback? localVideoStats, LocalAudioStatsCallback? localAudioStats, RemoteVideoStatsCallback? remoteVideoStats, RemoteAudioStatsCallback? remoteAudioStats, EmptyCallback? audioMixingFinished, AudioMixingStateCallback? audioMixingStateChanged, SoundIdCallback? audioEffectFinished, RtmpStreamingStateCallback? rtmpStreamingStateChanged, EmptyCallback? transcodingUpdated, StreamInjectedStatusCallback? streamInjectedStatus, StreamMessageCallback? streamMessage, StreamMessageErrorCallback? streamMessageError, EmptyCallback? mediaEngineLoadSuccess, EmptyCallback? mediaEngineStartCallSuccess, MediaRelayStateCallback? channelMediaRelayStateChanged, MediaRelayEventCallback? channelMediaRelayEvent, VideoFrameWithUidCallback? firstRemoteVideoFrame, UidWithElapsedCallback? firstRemoteAudioFrame, UidWithElapsedCallback? firstRemoteAudioDecoded, UidWithMutedCallback? userMuteAudio, UrlWithErrorCallback? streamPublished, UrlCallback? streamUnpublished, TransportStatsCallback? remoteAudioTransportStats, TransportStatsCallback? remoteVideoTransportStats, UidWithEnabledCallback? userEnableVideo, UidWithEnabledCallback? userEnableLocalVideo, VideoFrameWithUidCallback? firstRemoteVideoDecoded, EnabledCallback? microphoneEnabled, EmptyCallback? connectionInterrupted, EmptyCallback? connectionBanned, AudioQualityCallback? audioQuality, EmptyCallback? cameraReady, EmptyCallback? videoStopped, MetadataCallback? metadataReceived, ElapsedCallback? firstLocalAudioFramePublished, ElapsedCallback? firstLocalVideoFramePublished, StreamPublishStateCallback? audioPublishStateChanged, StreamPublishStateCallback? videoPublishStateChanged, StreamSubscribeStateCallback? audioSubscribeStateChanged, StreamSubscribeStateCallback? videoSubscribeStateChanged, RtmpStreamingEventCallback? rtmpStreamingEvent, MediaRecordStateChangeCallback? mediaRecordStateChangeCallback, MediaRecordUploadSuccessCallback? mediaRecordUploadSuccessCallback})
Constructs a RtcEngineEventHandler

Properties

activeSpeaker ↔ UidCallback?
Reports which user is the loudest speaker.
getter/setter pair
apiCallExecuted ↔ ApiCallCallback?
Occurs when an API method is executed.
getter/setter pair
audioEffectFinished ↔ SoundIdCallback?
Occurs when the audio effect file playback finishes.
getter/setter pair
audioMixingFinished ↔ EmptyCallback?
Occurs when the audio mixing file playback finishes.
getter/setter pair
audioMixingStateChanged ↔ AudioMixingStateCallback?
Occurs when the state of the local user's audio mixing file changes.
getter/setter pair
audioPublishStateChanged ↔ StreamPublishStateCallback?
Occurs when the audio publishing state changes.
getter/setter pair
audioQuality ↔ AudioQualityCallback?
Reports the statistics of the audio stream from each remote user/host.
getter/setter pair
audioRouteChanged ↔ AudioRouteCallback?
Occurs when the local audio playback route changes.
getter/setter pair
audioSubscribeStateChanged ↔ StreamSubscribeStateCallback?
Occurs when the audio subscribing state changes.
getter/setter pair
audioVolumeIndication ↔ AudioVolumeCallback?
Reports which users are speaking and the speakers' volume, and whether the local user is speaking.
getter/setter pair
cameraExposureAreaChanged ↔ RectCallback?
The camera exposure area has changed.
getter/setter pair
cameraFocusAreaChanged ↔ RectCallback?
Occurs when the camera focus area is changed.
getter/setter pair
cameraReady ↔ EmptyCallback?
Occurs when the camera is turned on and ready to capture video.
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.
getter/setter pair
clientRoleChanged ↔ ClientRoleCallback?
Occurs when the user role switches in a live broadcast. For example, from a host to an audience or from an audience to a host.
getter/setter pair
connectionBanned ↔ EmptyCallback?
Occurs when your connection is banned by the Meta Server.
getter/setter pair
connectionInterrupted ↔ EmptyCallback?
Occurs when the connection between the SDK and the server is interrupted.
getter/setter pair
connectionLost ↔ EmptyCallback?
Occurs when the SDK cannot reconnect to Meta's edge server 10 seconds after its connection to the server is interrupted.
getter/setter pair
connectionStateChanged ↔ ConnectionStateCallback?
Occurs when the network connection state changes.
getter/setter pair
error ↔ ErrorCallback?
Reports an error during SDK runtime.
getter/setter pair
facePositionChanged ↔ FacePositionCallback?
Reports the face detection result of the local user.
getter/setter pair
firstLocalAudioFrame ↔ ElapsedCallback?
Occurs when the first local audio frame is sent.
getter/setter pair
firstLocalAudioFramePublished ↔ ElapsedCallback?
Occurs when the first audio frame is published.
getter/setter pair
firstLocalVideoFrame ↔ VideoFrameCallback?
Occurs when the first local video frame is rendered.
getter/setter pair
firstLocalVideoFramePublished ↔ ElapsedCallback?
Occurs when the first video frame is published.
getter/setter pair
firstRemoteAudioDecoded ↔ UidWithElapsedCallback?
Occurs when the engine receives the first audio frame from a specified remote user.
getter/setter pair
firstRemoteAudioFrame ↔ UidWithElapsedCallback?
Occurs when the first remote audio frame is received.
getter/setter pair
firstRemoteVideoDecoded ↔ VideoFrameWithUidCallback?
Occurs when the first remote video frame is received and decoded.
getter/setter pair
firstRemoteVideoFrame ↔ VideoFrameWithUidCallback?
Occurs when the first remote video frame is rendered.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
joinChannelSuccess ↔ UidWithElapsedAndChannelCallback?
Occurs when the local user joins a specified channel.
getter/setter pair
lastmileProbeResult ↔ LastmileProbeCallback?
Reports the last-mile network probe result.
getter/setter pair
lastmileQuality ↔ NetworkQualityCallback?
Reports the last mile network quality of the local user once every two seconds before the user joins the channel. Last mile refers to the connection between the local device and Meta's edge server. After the application calls the RtcEngine.enableLastmileTest method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel.
getter/setter pair
leaveChannel ↔ RtcStatsCallback?
Occurs when a user leaves the channel.
getter/setter pair
localAudioStateChanged ↔ LocalAudioStateCallback?
Occurs when the local audio stream state changes.
getter/setter pair
localAudioStats ↔ LocalAudioStatsCallback?
Reports the statistics of the local audio stream.
getter/setter pair
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.
getter/setter pair
localUserRegistered ↔ UserAccountCallback?
Occurs when the local user registers a user account.
getter/setter pair
localVideoStateChanged ↔ LocalVideoStateCallback?
Occurs when the local video state changes.
getter/setter pair
localVideoStats ↔ LocalVideoStatsCallback?
Reports the statistics of the local video streams.
getter/setter pair
mediaEngineLoadSuccess ↔ EmptyCallback?
Occurs when the media engine is loaded.
getter/setter pair
mediaEngineStartCallSuccess ↔ EmptyCallback?
Occurs when the media engine starts.
getter/setter pair
mediaRecordStateChangeCallback ↔ MediaRecordStateChangeCallback?
getter/setter pair
mediaRecordUploadSuccessCallback ↔ MediaRecordUploadSuccessCallback?
getter/setter pair
metadataReceived ↔ MetadataCallback?
Occurs when the local user receives the metadata.
getter/setter pair
microphoneEnabled ↔ EnabledCallback?
Occurs when the microphone is enabled/disabled.
getter/setter pair
networkQuality ↔ NetworkQualityWithUidCallback?
Reports the last mile network quality of each user in the channel once every two seconds.
getter/setter pair
networkTypeChanged ↔ NetworkTypeCallback?
Occurs when the network type changes.
getter/setter pair
rejoinChannelSuccess ↔ RtcStatsCallback?
Occurs when a user rejoins the channel after being disconnected due to network problems.
getter/setter pair
remoteAudioStateChanged ↔ RemoteAudioStateCallback?
Occurs when the remote audio state changes.
getter/setter pair
remoteAudioStats ↔ RemoteAudioStatsCallback?
Reports the statistics of the audio stream from each remote user/host.
getter/setter pair
remoteAudioTransportStats ↔ TransportStatsCallback?
Reports the transport-layer statistics of each remote audio stream.
getter/setter pair
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.
getter/setter pair
remoteVideoStateChanged ↔ RemoteVideoStateCallback?
Occurs when the remote video state changes.
getter/setter pair
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/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.
getter/setter pair
remoteVideoTransportStats ↔ TransportStatsCallback?
Reports the transport-layer statistics of each remote video stream.
getter/setter pair
requestToken ↔ EmptyCallback?
Occurs when the token has expired.
getter/setter pair
rtcStats ↔ RtcStatsCallback?
Reports the statistics of the RtcEngine once every two seconds.
getter/setter pair
rtmpStreamingEvent ↔ RtmpStreamingEventCallback?
Reports events during the RTMP streaming.
getter/setter pair
rtmpStreamingStateChanged ↔ RtmpStreamingStateCallback?
Occurs when the state of the RTMP streaming changes.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamInjectedStatus ↔ StreamInjectedStatusCallback?
Reports the status of injecting the online media stream.
getter/setter pair
streamMessage ↔ StreamMessageCallback?
Occurs when the local user receives a remote data stream.
getter/setter pair
streamMessageError ↔ StreamMessageErrorCallback?
Occurs when the local user fails to receive a remote data stream.
getter/setter pair
streamPublished ↔ UrlWithErrorCallback?
Reports the result of calling the RtcEngine.addPublishStreamUrl method.
getter/setter pair
streamUnpublished ↔ UrlCallback?
Reports the result of calling the RtcEngine.removePublishStreamUrl method.
getter/setter pair
tokenPrivilegeWillExpire ↔ TokenCallback?
Occurs when the token expires in 30 seconds.
getter/setter pair
transcodingUpdated ↔ EmptyCallback?
Occurs when the publisher's transcoding settings are updated.
getter/setter pair
userEnableLocalVideo ↔ UidWithEnabledCallback?
Occurs when a remote user enables/disables the local video capture function.
getter/setter pair
userEnableVideo ↔ UidWithEnabledCallback?
Occurs when a remote user enables/disables the video module.
getter/setter pair
userInfoUpdated ↔ UserInfoCallback?
Occurs when the SDK gets the user ID and user account of the remote user.
getter/setter pair
userJoined ↔ UidWithElapsedCallback?
Occurs when a remote user (ChannelProfile.Communication)/host (ChannelProfile.LiveBroadcasting) joins the channel.
getter/setter pair
userMuteAudio ↔ UidWithMutedCallback?
Occurs when a remote user stops/resumes sending the audio stream.
getter/setter pair
userMuteVideo ↔ UidWithMutedCallback?
Occurs when a remote user stops/resumes sending the video stream.
getter/setter pair
userOffline ↔ UserOfflineCallback?
Occurs when a remote user (ChannelProfile.Communication)/host (ChannelProfile.LiveBroadcasting) leaves the channel.
getter/setter pair
videoPublishStateChanged ↔ StreamPublishStateCallback?
Occurs when the video publishing state changes.
getter/setter pair
videoSizeChanged ↔ VideoSizeCallback?
Occurs when the video size or rotation information of a remote user changes.
getter/setter pair
videoStopped ↔ EmptyCallback?
Occurs when the video stops playing.
getter/setter pair
videoSubscribeStateChanged ↔ StreamSubscribeStateCallback?
Occurs when the video subscribing state changes.
getter/setter pair
warning ↔ WarningCallback?
Reports a warning during SDK runtime.
getter/setter pair

Methods

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

Operators

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