Agora Java API Reference for Android

Public Member Functions | List of all members
agora::rtc::IRtcEngineEventHandlerEx Class Reference
Inheritance diagram for agora::rtc::IRtcEngineEventHandlerEx:

## Public Member Functions
virtual const char * | eventHandlerType () const
virtual void | onJoinChannelSuccess (const RtcConnection &connection, int elapsed)
virtual void | onRejoinChannelSuccess (const RtcConnection &connection, int elapsed)
virtual void | onAudioQuality (const RtcConnection &connection, uid_t remoteUid, int quality, unsigned short delay, unsigned short lost) __deprecated
virtual void | onAudioVolumeIndication (const RtcConnection &connection, const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
virtual void | onLeaveChannel (const RtcConnection &connection, const RtcStats &stats)
virtual void | onRtcStats (const RtcConnection &connection, const RtcStats &stats)
virtual void | onNetworkQuality (const RtcConnection &connection, uid_t remoteUid, int txQuality, int rxQuality)
virtual void | onIntraRequestReceived (const RtcConnection &connection)
virtual void | onFirstLocalVideoFramePublished (const RtcConnection &connection, int elapsed)
virtual void | onFirstRemoteVideoDecoded (const RtcConnection &connection, uid_t remoteUid, int width, int height, int elapsed)
virtual void | onVideoSizeChanged (const RtcConnection &connection, VIDEO_SOURCE_TYPE sourceType, uid_t uid, int width, int height, int rotation)
virtual void | onRemoteVideoStateChanged (const RtcConnection &connection, uid_t remoteUid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
virtual void | onFirstRemoteVideoFrame (const RtcConnection &connection, uid_t remoteUid, int width, int height, int elapsed)
virtual void | onUserJoined (const RtcConnection &connection, uid_t remoteUid, int elapsed)
virtual void | onUserOffline (const RtcConnection &connection, uid_t remoteUid, USER_OFFLINE_REASON_TYPE reason)
virtual void | onUserMuteAudio (const RtcConnection &connection, uid_t remoteUid, bool muted) __deprecated
virtual void | onUserMuteVideo (const RtcConnection &connection, uid_t remoteUid, bool muted)
virtual void | onUserEnableVideo (const RtcConnection &connection, uid_t remoteUid, bool enabled)
virtual void | onUserEnableLocalVideo (const RtcConnection &connection, uid_t remoteUid, bool enabled) __deprecated
virtual void | onUserStateChanged (const RtcConnection &connection, uid_t remoteUid, uint32_t state)
virtual void | onLocalAudioStats (const RtcConnection &connection, const LocalAudioStats &stats)
virtual void | onRemoteAudioStats (const RtcConnection &connection, const RemoteAudioStats &stats)
virtual void | onLocalVideoStats (const RtcConnection &connection, VIDEO_SOURCE_TYPE sourceType, const LocalVideoStats &stats)
virtual void | onRemoteVideoStats (const RtcConnection &connection, const RemoteVideoStats &stats)
virtual void | onConnectionLost (const RtcConnection &connection)
virtual void | onConnectionInterrupted (const RtcConnection &connection) __deprecated
virtual void | onConnectionBanned (const RtcConnection &connection)
virtual void | onStreamMessage (const RtcConnection &connection, uid_t remoteUid, int streamId, const char *data, size_t length, uint64_t sentTs)
virtual void | onStreamMessageError (const RtcConnection &connection, uid_t remoteUid, int streamId, int code, int missed, int cached)
virtual void | onRdtMessage (const RtcConnection &connection, uid_t userId, RdtStreamType type, const char *data, size_t length)
| Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user. More...
virtual void | onRdtStateChanged (const RtcConnection &connection, uid_t userId, RdtState state)
| Occurs when the RDT tunnel state changed. More...
virtual void | onMediaControlMessage (const RtcConnection &connection, uid_t userId, const char *data, size_t length)
| Occurs when the local user receives media control message sent by a remote user. More...
virtual void | onRequestToken (const RtcConnection &connection)
virtual void | onLicenseValidationFailure (const RtcConnection &connection, LICENSE_ERROR_TYPE reason)
virtual void | onTokenPrivilegeWillExpire (const RtcConnection &connection, const char *token)
virtual void | onFirstLocalAudioFramePublished (const RtcConnection &connection, int elapsed)
virtual void | onFirstRemoteAudioFrame (const RtcConnection &connection, uid_t userId, int elapsed) __deprecated
virtual void | onFirstRemoteAudioDecoded (const RtcConnection &connection, uid_t uid, int elapsed) __deprecated
virtual void | onLocalAudioStateChanged (const RtcConnection &connection, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason)
virtual void | onRemoteAudioStateChanged (const RtcConnection &connection, uid_t remoteUid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
virtual void | onActiveSpeaker (const RtcConnection &connection, uid_t uid)
virtual void | onClientRoleChanged (const RtcConnection &connection, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole, const ClientRoleOptions &newRoleOptions)
virtual void | onClientRoleChangeFailed (const RtcConnection &connection, CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole)
virtual void | onRemoteAudioTransportStats (const RtcConnection &connection, uid_t remoteUid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
virtual void | onRemoteVideoTransportStats (const RtcConnection &connection, uid_t remoteUid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
virtual void | onConnectionStateChanged (const RtcConnection &connection, CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
virtual void | onNetworkTypeChanged (const RtcConnection &connection, NETWORK_TYPE type)
virtual void | onEncryptionError (const RtcConnection &connection, ENCRYPTION_ERROR_TYPE errorType)
virtual void | onUploadLogResult (const RtcConnection &connection, const char *requestId, bool success, UPLOAD_ERROR_REASON reason)
virtual void | onUserAccountUpdated (const RtcConnection &connection, uid_t remoteUid, const char *remoteUserAccount)
virtual void | onSnapshotTaken (const RtcConnection &connection, uid_t uid, const char *filePath, int width, int height, int errCode)
virtual void | onVideoRenderingTracingResult (const RtcConnection &connection, uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo)
virtual void | onSetRtmFlagResult (const RtcConnection &connection, int code)
virtual void | onTranscodedStreamLayoutInfo (const RtcConnection &connection, uid_t uid, int width, int height, int layoutCount, const VideoLayout *layoutlist)
virtual void | onAudioMetadataReceived (const RtcConnection &connection, uid_t uid, const char *metadata, size_t length)
virtual void | onMultipathStats (const RtcConnection &connection, const MultipathStats &stats)
| Callback for multipath transmission statistics. More...
virtual void | onRenewTokenResult (const RtcConnection &connection, const char *token, RENEW_TOKEN_ERROR_CODE code)
virtual const char * | eventHandlerType () const
virtual void | onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
| Occurs when a user joins a channel. More...
virtual void | onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
| Occurs when a user rejoins the channel. More...
virtual void | onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost) __deprecated
| Reports the statistics of the audio stream sent by each remote user. More...
virtual void | onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
| Reports the volume information of users. More...
virtual void | onLeaveChannel (const RtcStats &stats)
| Occurs when a user leaves a channel. More...
virtual void | onRtcStats (const RtcStats &stats)
| Reports the statistics about the current call. More...
virtual void | onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
| Reports the last mile network quality of each user in the channel. More...
virtual void | onIntraRequestReceived ()
virtual void | onFirstLocalVideoFramePublished (VIDEO_SOURCE_TYPE source, int elapsed)
| Occurs when the first video frame is published. More...
virtual void | onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed) __deprecated
| Occurs when the first remote video frame is received and decoded. More...
virtual void | onVideoSizeChanged (VIDEO_SOURCE_TYPE sourceType, uid_t uid, int width, int height, int rotation)
| Occurs when the video size or rotation of a specified user changes. More...
virtual void | onLocalVideoStateChanged (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_REASON reason)
| Occurs when the local video stream state changes. More...
virtual void | onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
| Occurs when the remote video stream state changes. More...
virtual void | onFirstRemoteVideoFrame (uid_t uid, int width, int height, int elapsed)
| Occurs when the renderer receives the first frame of the remote video. More...
virtual void | onUserJoined (uid_t uid, int elapsed)
| Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel. More...
virtual void | onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason)
| Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel. More...
virtual void | onUserMuteAudio (uid_t uid, 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. More...
virtual void | onUserMuteVideo (uid_t uid, bool muted)
| Occurs when a remote user stops or resumes publishing the video stream. More...
virtual void | onUserEnableVideo (uid_t uid, bool enabled)
| Occurs when a remote user enables or disables the video module. More...
virtual void | onUserEnableLocalVideo (uid_t uid, bool enabled) __deprecated
| Occurs when a specific remote user enables/disables the local video capturing function. More...
virtual void | onUserStateChanged (uid_t uid, REMOTE_USER_STATE state)
virtual void | onLocalAudioStats (const LocalAudioStats &stats)
| Reports the statistics of the local audio stream. More...
virtual void | onRemoteAudioStats (const RemoteAudioStats &stats)
| Reports the transport-layer statistics of each remote audio stream. More...
virtual void | onLocalVideoStats (VIDEO_SOURCE_TYPE source, const LocalVideoStats &stats)
| Reports the statistics of the local video stream. More...
virtual void | onRemoteVideoStats (const RemoteVideoStats &stats)
| Reports the statistics of the video stream sent by each remote users. More...
virtual void | onConnectionLost ()
| Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. More...
virtual void | onConnectionInterrupted () __deprecated
| Occurs when the connection between the SDK and the server is interrupted. More...
virtual void | onConnectionBanned () __deprecated
| Occurs when the connection is banned by the Agora server. More...
virtual void | onStreamMessage (uid_t uid, int streamId, const char *data, size_t length, uint64_t sentTs)
| Occurs when the local user receives the data stream from the remote user. More...
virtual void | onStreamMessageError (uid_t uid, int streamId, int code, int missed, int cached)
| Occurs when the local user does not receive the data stream from the remote user. More...
virtual void | onRdtMessage (uid_t userId, RdtStreamType type, const char *data, size_t length)
| Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user. More...
virtual void | onRdtStateChanged (uid_t userId, RdtState state)
| Occurs when the RDT tunnel state changed. More...
virtual void | onMediaControlMessage (uid_t userId, const char *data, size_t length)
| Occurs when the local user receives media control message sent by a remote user. More...
virtual void | onRequestToken ()
| Occurs when the token expires. More...
virtual void | onTokenPrivilegeWillExpire (const char *token)
| Occurs when the token expires in 30 seconds. More...
virtual void | onLicenseValidationFailure (LICENSE_ERROR_TYPE error)
virtual void | onFirstLocalAudioFramePublished (int elapsed)
| Occurs when the first audio frame is published. More...
virtual void | onFirstRemoteAudioFrame (uid_t uid, int elapsed) __deprecated
| Occurs when the SDK receives the first audio frame from a specific remote user. More...
virtual void | onFirstRemoteAudioDecoded (uid_t uid, int elapsed) __deprecated
| Occurs when the SDK decodes the first remote audio frame for playback. More...
virtual void | onLocalAudioStateChanged (LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason)
| Occurs when the local audio stream state changes. More...
virtual void | onRemoteAudioStateChanged (uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
| Occurs when the remote audio state changes. More...
virtual void | onActiveSpeaker (uid_t uid)
| Occurs when the most active remote speaker is detected. More...
virtual void | onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole, const ClientRoleOptions &newRoleOptions)
| Occurs when the user role or the audience latency level changes. More...
virtual void | onClientRoleChangeFailed (CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole)
| Occurs when switching a user role fails. More...
virtual void | onRemoteAudioTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
| Reports the transport-layer statistics of each remote audio stream. More...
virtual void | onRemoteVideoTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
| Reports the transport-layer statistics of each remote video stream. More...
virtual void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
| Occurs when the network connection state changes. More...
virtual void | onNetworkTypeChanged (NETWORK_TYPE type)
| Occurs when the local network type changes. More...
virtual void | onEncryptionError (ENCRYPTION_ERROR_TYPE errorType)
| Reports the built-in encryption errors. More...
virtual void | onUploadLogResult (const char *requestId, bool success, UPLOAD_ERROR_REASON reason)
virtual void | onUserInfoUpdated (uid_t uid, const UserInfo &info)
| Occurs when the SDK gets the user ID and user account of the remote user. More...
virtual void | onUserAccountUpdated (uid_t uid, const char *userAccount)
virtual void | onAudioSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
| Occurs when the audio subscribing state changes. More...
virtual void | onVideoSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
| Occurs when the video subscribing state changes. More...
virtual void | onAudioPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
| Occurs when the audio publishing state changes. More...
virtual void | onVideoPublishStateChanged (VIDEO_SOURCE_TYPE source, const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
| Occurs when the video publishing state changes. More...
virtual void | onSnapshotTaken (uid_t uid, const char *filePath, int width, int height, int errCode)
| Reports the result of taking a video snapshot. More...
virtual void | onVideoRenderingTracingResult (uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo)
| Video frame rendering event callback. More...
virtual void | onSetRtmFlagResult (int code)
virtual void | onTranscodedStreamLayoutInfo (uid_t uid, int width, int height, int layoutCount, const VideoLayout *layoutlist)
| Occurs when the local user receives a mixed video stream carrying layout information. More...
virtual void | onAudioMetadataReceived (uid_t uid, const char *metadata, size_t length)
virtual void | onMultipathStats (const MultipathStats &stats)
| Report the multipath transmission statistics. More...
virtual void | onRenewTokenResult (const char *token, RENEW_TOKEN_ERROR_CODE code)
| Callback for `renewToken` call result. More...
Public Member Functions inherited from agora::rtc::IRtcEngineEventHandler
virtual void | onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
| Occurs when a user joins a channel. More...
virtual void | onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
| Occurs when a user rejoins the channel. More...
virtual void | onProxyConnected (const char *channel, uid_t uid, PROXY_TYPE proxyType, const char *localProxyIp, int elapsed)
| Reports the proxy connection state. More...
virtual void | onError (int err, const char *msg)
| Reports an error during SDK runtime. More...
virtual void | onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost) __deprecated
| Reports the statistics of the audio stream sent by each remote user. More...
virtual void | onLastmileProbeResult (const LastmileProbeResult &result)
| Reports the last mile network probe result. More...
virtual void | onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
| Reports the volume information of users. More...
virtual void | onLeaveChannel (const RtcStats &stats)
| Occurs when a user leaves a channel. More...
virtual void | onRtcStats (const RtcStats &stats)
| Reports the statistics about the current call. More...
virtual void | onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
| Occurs when the audio device state changes. More...
virtual void | onAudioMixingPositionChanged (int64_t position)
| Reports the playback progress of a music file. More...
virtual void | onAudioMixingFinished () __deprecated
| Occurs when the playback of the local music file finishes. More...
virtual void | onAudioEffectFinished (int soundId)
| Occurs when the playback of the local music file finishes. More...
virtual void | onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
| Occurs when the video device state changes. More...
virtual void | onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
| Reports the last mile network quality of each user in the channel. More...
virtual void | onIntraRequestReceived ()
virtual void | onUplinkNetworkInfoUpdated (const UplinkNetworkInfo &info)
| Occurs when the uplink network information changes. More...
virtual void | onLastmileQuality (int quality)
| Reports the last-mile network quality of the local user. More...
virtual void | onFirstLocalVideoFrame (VIDEO_SOURCE_TYPE source, int width, int height, int elapsed)
| Occurs when the first local video frame is displayed on the local video view. More...
virtual void | onFirstLocalVideoFramePublished (VIDEO_SOURCE_TYPE source, int elapsed)
| Occurs when the first video frame is published. More...
virtual void | onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed) __deprecated
| Occurs when the first remote video frame is received and decoded. More...
virtual void | onVideoSizeChanged (VIDEO_SOURCE_TYPE sourceType, uid_t uid, int width, int height, int rotation)
| Occurs when the video size or rotation of a specified user changes. More...
virtual void | onLocalVideoEvent (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_EVENT_TYPE event)
| Occurs when the local video event occurs. More...
virtual void | onLocalVideoStateChanged (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_REASON reason)
| Occurs when the local video stream state changes. More...
virtual void | onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
| Occurs when the remote video stream state changes. More...
virtual void | onFirstRemoteVideoFrame (uid_t uid, int width, int height, int elapsed)
| Occurs when the renderer receives the first frame of the remote video. More...
virtual void | onUserJoined (uid_t uid, int elapsed)
| Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel. More...
virtual void | onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason)
| Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel. More...
virtual void | onUserMuteAudio (uid_t uid, 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. More...
virtual void | onUserMuteVideo (uid_t uid, bool muted)
| Occurs when a remote user stops or resumes publishing the video stream. More...
virtual void | onUserEnableVideo (uid_t uid, bool enabled)
| Occurs when a remote user enables or disables the video module. More...
virtual void | onUserStateChanged (uid_t uid, REMOTE_USER_STATE state)
virtual void | onUserEnableLocalVideo (uid_t uid, bool enabled) __deprecated
| Occurs when a specific remote user enables/disables the local video capturing function. More...
virtual void | onRemoteAudioStats (const RemoteAudioStats &stats)
| Reports the transport-layer statistics of each remote audio stream. More...
virtual void | onLocalAudioStats (const LocalAudioStats &stats)
| Reports the statistics of the local audio stream. More...
virtual void | onLocalVideoStats (VIDEO_SOURCE_TYPE source, const LocalVideoStats &stats)
| Reports the statistics of the local video stream. More...
virtual void | onRemoteVideoStats (const RemoteVideoStats &stats)
| Reports the statistics of the video stream sent by each remote users. More...
virtual void | onCameraReady () __deprecated
| Occurs when the camera turns on and is ready to capture the video. More...
virtual void | onCameraFocusAreaChanged (int x, int y, int width, int height)
| Occurs when the camera focus area changes. More...
virtual void | onCameraExposureAreaChanged (int x, int y, int width, int height)
| Occurs when the camera exposure area changes. More...
virtual void | onVideoStopped () __deprecated
| Occurs when the video stops playing. More...
virtual void | onAudioMixingStateChanged (AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_REASON_TYPE reason)
| Occurs when the playback state of the music file changes. More...
virtual void | onRhythmPlayerStateChanged (RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_REASON reason)
| Occurs when the state of virtual metronome changes. More...
virtual void | onConnectionLost ()
| Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. More...
virtual void | onConnectionInterrupted () __deprecated
| Occurs when the connection between the SDK and the server is interrupted. More...
virtual void | onConnectionBanned () __deprecated
| Occurs when the connection is banned by the Agora server. More...
virtual void | onStreamMessage (uid_t uid, int streamId, const char *data, size_t length, uint64_t sentTs)
| Occurs when the local user receives the data stream from the remote user. More...
virtual void | onStreamMessageError (uid_t uid, int streamId, int code, int missed, int cached)
| Occurs when the local user does not receive the data stream from the remote user. More...
virtual void | onRdtMessage (uid_t userId, RdtStreamType type, const char *data, size_t length)
| Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user. More...
virtual void | onRdtStateChanged (uid_t userId, RdtState state)
| Occurs when the RDT tunnel state changed. More...
virtual void | onMediaControlMessage (uid_t userId, const char *data, size_t length)
| Occurs when the local user receives media control message sent by a remote user. More...
virtual void | onRequestToken ()
| Occurs when the token expires. More...
virtual void | onTokenPrivilegeWillExpire (const char *token)
| Occurs when the token expires in 30 seconds. More...
virtual void | onLicenseValidationFailure (LICENSE_ERROR_TYPE error)
virtual void | onFirstLocalAudioFramePublished (int elapsed)
| Occurs when the first audio frame is published. More...
virtual void | onFirstRemoteAudioDecoded (uid_t uid, int elapsed) __deprecated
| Occurs when the SDK decodes the first remote audio frame for playback. More...
virtual void | onFirstRemoteAudioFrame (uid_t uid, int elapsed) __deprecated
| Occurs when the SDK receives the first audio frame from a specific remote user. More...
virtual void | onLocalAudioStateChanged (LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason)
| Occurs when the local audio stream state changes. More...
virtual void | onRemoteAudioStateChanged (uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
| Occurs when the remote audio state changes. More...
virtual void | onActiveSpeaker (uid_t uid)
| Occurs when the most active remote speaker is detected. More...
virtual void | onContentInspectResult (media::CONTENT_INSPECT_RESULT result)
virtual void | onSnapshotTaken (uid_t uid, const char *filePath, int width, int height, int errCode)
| Reports the result of taking a video snapshot. More...
virtual void | onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole, const ClientRoleOptions &newRoleOptions)
| Occurs when the user role or the audience latency level changes. More...
virtual void | onClientRoleChangeFailed (CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole)
| Occurs when switching a user role fails. More...
virtual void | onAudioDeviceVolumeChanged (MEDIA_DEVICE_TYPE deviceType, int volume, bool muted)
| Reports the volume change of the audio device or app. More...
virtual void | onRtmpStreamingStateChanged (const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_REASON reason)
| Occurs when the state of Media Push changes. More...
virtual void | onRtmpStreamingEvent (const char *url, RTMP_STREAMING_EVENT eventCode)
| Reports events during the Media Push. More...
virtual void | onTranscodingUpdated ()
| Occurs when the publisher's transcoding is updated. More...
virtual void | onAudioRoutingChanged (int routing)
| Occurs when the local audio route changes. More...
virtual void | onChannelMediaRelayStateChanged (int state, int code)
| Occurs when the state of the media stream relay changes. More...
virtual void | onRemoteSubscribeFallbackToAudioOnly (uid_t 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. More...
virtual void | onRemoteAudioTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
| Reports the transport-layer statistics of each remote audio stream. More...
virtual void | onRemoteVideoTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
| Reports the transport-layer statistics of each remote video stream. More...
virtual void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
| Occurs when the network connection state changes. More...
virtual void | onNetworkTypeChanged (NETWORK_TYPE type)
| Occurs when the local network type changes. More...
virtual void | onEncryptionError (ENCRYPTION_ERROR_TYPE errorType)
| Reports the built-in encryption errors. More...
virtual void | onPermissionError (PERMISSION_TYPE permissionType)
| Occurs when the SDK cannot get the device permission. More...
virtual void | onLocalUserRegistered (uid_t uid, const char *userAccount)
| Occurs when the local user registers a user account. More...
virtual void | onUserInfoUpdated (uid_t uid, const UserInfo &info)
| Occurs when the SDK gets the user ID and user account of the remote user. More...
virtual void | onUserAccountUpdated (uid_t uid, const char *userAccount)
virtual void | onVideoRenderingTracingResult (uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo)
| Video frame rendering event callback. More...
virtual void | onLocalVideoTranscoderError (const TranscodingVideoStream &stream, VIDEO_TRANSCODER_ERROR error)
| Occurs when there's an error during the local video mixing. More...
virtual void | onUploadLogResult (const char *requestId, bool success, UPLOAD_ERROR_REASON reason)
virtual void | onAudioSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
| Occurs when the audio subscribing state changes. More...
virtual void | onVideoSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
| Occurs when the video subscribing state changes. More...
virtual void | onAudioPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
| Occurs when the audio publishing state changes. More...
virtual void | onVideoPublishStateChanged (VIDEO_SOURCE_TYPE source, const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
| Occurs when the video publishing state changes. More...
virtual void | onTranscodedStreamLayoutInfo (uid_t uid, int width, int height, int layoutCount, const VideoLayout *layoutlist)
| Occurs when the local user receives a mixed video stream carrying layout information. More...
virtual void | onAudioMetadataReceived (uid_t uid, const char *metadata, size_t length)
virtual void | onExtensionEventWithContext (const ExtensionContext &context, const char *key, const char *value)
| The event callback of the extension. More...
virtual void | onExtensionStartedWithContext (const ExtensionContext &context)
| Occurrs when the extension is enabled. More...
virtual void | onExtensionStoppedWithContext (const ExtensionContext &context)
| Occurs when the extension is disabled. More...
virtual void | onExtensionErrorWithContext (const ExtensionContext &context, int error, const char *message)
| Occurs when the extension runs incorrectly. More...
virtual void | onSetRtmFlagResult (int code)
virtual void | onMultipathStats (const MultipathStats &stats)
| Report the multipath transmission statistics. More...
virtual void | onRenewTokenResult (const char *token, RENEW_TOKEN_ERROR_CODE code)
| Callback for `renewToken` call result. More...

## Member Function Documentation

## ◆ onJoinChannelSuccess() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onJoinChannelSuccess | ( | const RtcConnection & | connection,
|  | int | elapsed
| ) |  |
| virtual

Occurs when a user joins a channel.

This callback notifies the application that a user joins a specified channel.

Parameters

  connection | The RtcConnection object.
  elapsed | The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.

## ◆ onRejoinChannelSuccess() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRejoinChannelSuccess | ( | const RtcConnection & | connection,
|  | int | elapsed
| ) |  |
| virtual

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.

Parameters

  connection | The RtcConnection object.
  elapsed | Time elapsed (ms) from the local user calling the joinChannel method until this callback is triggered.

## ◆ onAudioQuality() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioQuality | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | quality,
|  | unsigned short | delay,
|  | unsigned short | lost
| ) |  |
| virtual

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

Deprecated:
  This callback is deprecated. Use onRemoteAudioStats instead.

The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple remote users/hosts sending audio streams, the SDK triggers this callback as many times.

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID of the remote user sending the audio stream.
  quality | The audio quality of the user: #QUALITY_TYPE
  delay | The network delay (ms) from the sender to the receiver, including the delay caused by audio sampling pre-processing, network transmission, and network jitter buffering.
  lost | The audio packet loss rate (%) from the sender to the receiver.

## ◆ onAudioVolumeIndication() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioVolumeIndication | ( | const RtcConnection & | connection,
|  | const AudioVolumeInfo * | speakers,
|  | unsigned int | speakerNumber,
|  | int | totalVolume
| ) |  |
| virtual

Reports the volume information of users.

By default, this callback is disabled. You can enable it by calling `enableAudioVolumeIndication`. Once this callback is enabled and users send streams in the channel, the SDK triggers the `onAudioVolumeIndication` callback at the time interval set in `enableAudioVolumeIndication`. The SDK triggers two independent `onAudioVolumeIndication` callbacks simultaneously, which separately report the volume information of the local user who sends a stream and the remote users (up to three) whose instantaneous volume is the highest.

Note
  After you enable this callback, calling muteLocalAudioStream affects the SDK's behavior as follows:
  - If the local user stops publishing the audio stream, the SDK stops triggering the local user's callback.
  - 20 seconds after a remote user whose volume is one of the three highest stops publishing the audio stream, the callback excludes this user's information; 20 seconds after all remote users stop publishing audio streams, the SDK stops triggering the callback for remote users.

Parameters

  connection | The RtcConnection object.
  speakers | The volume information of the users, see AudioVolumeInfo. An empty `speakers` array in the callback indicates that no remote user is in the channel or sending a stream at the moment.
  speakerNumber | The total number of speakers. In the local user's callback, when the local user sends a stream, `speakerNumber` is 1. In the callback for remote users, the value range of speakerNumber is [0,3]. If the number of remote users who send streams is greater than or equal to three, the value of `speakerNumber` is 3.
  totalVolume | The volume of the speaker. The value ranges between 0 (lowest volume) and 255 (highest volume). In the local user's callback, `totalVolume` is the volume of the local user who sends a stream. In the remote users' callback, `totalVolume` is the sum of all remote users (up to three) whose instantaneous volume is the highest. If the user calls `startAudioMixing`, `totalVolume` is the volume after audio mixing.

## ◆ onLeaveChannel() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLeaveChannel | ( | const RtcConnection & | connection,
|  | const RtcStats & | stats
| ) |  |
| virtual

Occurs when a user leaves a channel.

This callback notifies the app that the user leaves the channel by calling `leaveChannel`. From this callback, the app can get information such as the call duration and quality statistics.

Parameters

  connection | The RtcConnection object.
  stats | The statistics on the call: RtcStats.

## ◆ onRtcStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRtcStats | ( | const RtcConnection & | connection,
|  | const RtcStats & | stats
| ) |  |
| virtual

Reports the statistics of the current call.

The SDK triggers this callback once every two seconds after the user joins the channel.

Parameters

  connection | The RtcConnection object.
  stats | The statistics of the current call: RtcStats.

## ◆ onNetworkQuality() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onNetworkQuality | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | txQuality,
|  | int | rxQuality
| ) |  |
| virtual

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.

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

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID. The network quality of the user with this user ID is reported.
  txQuality | Uplink network quality rating of the user in terms of the transmission bit rate, packet loss rate, average RTT (Round-Trip Time) and jitter of the uplink network. This parameter is a quality rating helping you understand how well the current uplink network conditions can support the selected video encoder configuration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the LIVE_BROADCASTING profile, but may be inadequate for resolutions higher than 1280 × 720. See #QUALITY_TYPE.
  rxQuality | Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. See #QUALITY_TYPE.

## ◆ onIntraRequestReceived() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onIntraRequestReceived | ( | const RtcConnection & | connection | ) |
| virtual

Occurs when intra request from remote user is received.

This callback is triggered once remote user needs one Key frame.

Parameters

  connection | The RtcConnection object.

## ◆ onFirstLocalVideoFramePublished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstLocalVideoFramePublished | ( | const RtcConnection & | connection,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the first local video frame is published. The SDK triggers this callback under one of the following circumstances:

- The local client enables the video module and calls `joinChannel` successfully.
- The local client calls `muteLocalVideoStream(true)` and muteLocalVideoStream(false) in sequence.
- The local client calls `disableVideo` and `enableVideo` in sequence.
- The local client calls `pushVideoFrame` to successfully push the video frame to the SDK.

Parameters

  connection | The RtcConnection object.
  elapsed | The time elapsed (ms) from the local user calling joinChannel` to the SDK triggers this callback.

## ◆ onFirstRemoteVideoDecoded() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteVideoDecoded | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | width,
|  | int | height,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the first remote video frame is received and decoded.

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

- The remote user joins the channel and sends the video stream.
- The remote user stops sending the video stream and re-sends it after 15 seconds. Reasons for such an interruption include:
  - The remote user leaves the channel.
  - The remote user drops offline.
  - The remote user calls `muteLocalVideoStream` to stop sending the video stream.
  - The remote user calls `disableVideo` to disable video.

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID of the remote user sending the video stream.
  width | The width (pixels) of the video stream.
  height | The height (pixels) of the video stream.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel` until the SDK triggers this callback.

## ◆ onVideoSizeChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onVideoSizeChanged | ( | const RtcConnection & | connection,
|  | VIDEO_SOURCE_TYPE | sourceType,
|  | uid_t | uid,
|  | int | width,
|  | int | height,
|  | int | rotation
| ) |  |
| virtual

Occurs when the local or remote video size or rotation has changed.

Parameters

  connection | The RtcConnection object.
  sourceType | The video source type: #VIDEO_SOURCE_TYPE.
  uid | The user ID. 0 indicates the local user.
  width | The new width (pixels) of the video.
  height | The new height (pixels) of the video.
  rotation | The rotation information of the video.

## ◆ onRemoteVideoStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoStateChanged | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | REMOTE_VIDEO_STATE | state,
|  | REMOTE_VIDEO_STATE_REASON | reason,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the remote video state changes.

Note
  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.

Parameters

  connection | The RtcConnection object.
  remoteUid | The ID of the user whose video state has changed.
  state | The remote video state: #REMOTE_VIDEO_STATE.
  reason | The reason of the remote video state change: #REMOTE_VIDEO_STATE_REASON.
  elapsed | The time elapsed (ms) from the local client calling `joinChannel` until this callback is triggered.

## ◆ onFirstRemoteVideoFrame() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteVideoFrame | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | width,
|  | int | height,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the renderer receives the first frame of the remote video.

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID of the remote user sending the video stream.
  width | The width (px) of the video frame.
  height | The height (px) of the video stream.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel` until the SDK triggers this callback.

## ◆ onUserJoined() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserJoined | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | elapsed
| ) |  |
| virtual

Occurs when a remote user or broadcaster joins the channel.

- In the COMMUNICATION channel profile, 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 the LIVE_BROADCASTING channel profile, 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.

Parameters

  connection | The RtcConnection object.
  remoteUid | The ID of the remote user or broadcaster joining the channel.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel` or `setClientRole` until this callback is triggered.

## ◆ onUserOffline() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserOffline | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | USER_OFFLINE_REASON_TYPE | reason
| ) |  |
| virtual

Occurs when a remote user or broadcaster goes offline.

There are two reasons for a user to go offline:

- Leave the channel: When the user leaves the channel, the user sends a goodbye message. When this message is received, the SDK determines that the user leaves the channel.
- Drop offline: When no data packet of the user is received for a certain period of time, the SDK assumes that the user drops offline. A poor network connection may lead to false detection, so we recommend using the RTM SDK for reliable offline detection.
- The user switches the user role from a broadcaster to an audience.

Parameters

  connection | The RtcConnection object.
  remoteUid | The ID of the remote user or broadcaster who leaves the channel or drops offline.
  reason | The reason why the remote user goes offline: #USER_OFFLINE_REASON_TYPE.

## ◆ onUserMuteAudio() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserMuteAudio | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | bool | muted
| ) |  |
| virtual

Occurs when a remote user's audio stream playback pauses/resumes. The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the `muteLocalAudioStream` method.

Note
  This callback can be inaccurate when the number of users (in the `COMMUNICATION` profile) or hosts (in the `LIVE_BROADCASTING` profile) in the channel exceeds 17.

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID.
  muted | Whether the remote user's audio stream is muted/unmuted: true: Muted. false: Unmuted.

## ◆ onUserMuteVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserMuteVideo | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | bool | muted
| ) |  |
| virtual

Occurs when a remote user pauses or resumes sending the video stream.

When a remote user calls `muteLocalVideoStream` to stop or resume publishing the video stream, the SDK triggers this callback to report the state of the remote user's publishing stream to the local user.

Note
  This callback can be inaccurate when the number of users or broadacasters in a channel exceeds 20.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the remote user.
  muted | Whether the remote user stops publishing the video stream: true: The remote user has paused sending the video stream. false: The remote user has resumed sending the video stream.

## ◆ onUserEnableVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserEnableVideo | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | bool | enabled
| ) |  |
| virtual

Occurs when a remote user enables or disables the video module.

Once the video function is disabled, the users cannot see any video.

The SDK triggers this callback when a remote user enables or disables the video module by calling the `enableVideo` or `disableVideo` method.

Parameters

  connection | The RtcConnection object.
  remoteUid | The ID of the remote user.
  enabled | Whether the video of the remote user is enabled: true: The remote user has enabled video. false: The remote user has disabled video.

## ◆ onUserEnableLocalVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserEnableLocalVideo | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | bool | enabled
| ) |  |
| virtual

Occurs when a remote user enables or disables local video capturing.

The SDK triggers this callback when the remote user resumes or stops capturing the video stream by calling the `enableLocalVideo` method.

Parameters

  connection | The RtcConnection object.
  remoteUid | The ID of the remote user.
  enabled | Whether the specified remote user enables/disables local video: `true`: The remote user has enabled local video capturing. `false`: The remote user has disabled local video capturing.

## ◆ onUserStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserStateChanged | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | uint32_t | state
| ) |  |
| virtual

Occurs when the remote user state is updated.

Parameters

  connection | The RtcConnection object.
  remoteUid | The uid of the remote user.
  state | The remote user state: #REMOTE_USER_STATE.

## ◆ onLocalAudioStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalAudioStats | ( | const RtcConnection & | connection,
|  | const LocalAudioStats & | stats
| ) |  |
| virtual

Reports the statistics of the local audio stream.

The SDK triggers this callback once every two seconds.

Parameters

  connection | The RtcConnection object.
  stats | The statistics of the local audio stream. See LocalAudioStats.

## ◆ onRemoteAudioStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioStats | ( | const RtcConnection & | connection,
|  | const RemoteAudioStats & | stats
| ) |  |
| virtual

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 who is sending audio streams. If a channel includes multiple remote users, the SDK triggers this callback as many times.

Parameters

  connection | The RtcConnection object.
  stats | Statistics of the received remote audio streams. See RemoteAudioStats.

## ◆ onLocalVideoStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalVideoStats | ( | const RtcConnection & | connection,
|  | VIDEO_SOURCE_TYPE | sourceType,
|  | const LocalVideoStats & | stats
| ) |  |
| virtual

Reports the statistics of the local video stream.

The SDK triggers this callback once every two seconds for each user/host. If there are multiple users/hosts in the channel, the SDK triggers this callback as many times.

Note
  If you have called the `enableDualStreamMode` method, this callback reports the statistics of the high-video stream (high bitrate, and high-resolution video stream).

Parameters

  connection | The RtcConnection object.
  sourceType | The video source type: #VIDEO_SOURCE_TYPE.
  stats | Statistics of the local video stream. See LocalVideoStats.

## ◆ onRemoteVideoStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoStats | ( | const RtcConnection & | connection,
|  | const RemoteVideoStats & | stats
| ) |  |
| virtual

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. If a channel has multiple users/hosts sending video streams, the SDK triggers this callback as many times.

Parameters

  connection | The RtcConnection object.
  stats | Statistics of the remote video stream. See RemoteVideoStats.

## ◆ onConnectionLost() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionLost | ( | const RtcConnection & | connection | ) |
| virtual

Occurs when the SDK cannot reconnect to the 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 `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.

Parameters

  connection | The RtcConnection object.

## ◆ onConnectionInterrupted() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionInterrupted | ( | const RtcConnection & | connection | ) |
| virtual

Occurs when the connection between the SDK and the server is interrupted.

Deprecated:
  Use `onConnectionStateChanged` instead.

The SDK triggers this callback when it loses connection with the serer for more than 4 seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. If the reconnection fails within a certain period (10 seconds by default), the onConnectionLost() callback is triggered. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.

Parameters

  connection | The RtcConnection object.

## ◆ onConnectionBanned() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionBanned | ( | const RtcConnection & | connection | ) |
| virtual

Occurs when your connection is banned by the Agora Server.

Parameters

  connection | The RtcConnection object.

## ◆ onStreamMessage() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamMessage | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | streamId,
|  | const char * | data,
|  | size_t | length,
|  | uint64_t | sentTs
| ) |  |
| virtual

Occurs when the local user receives the data stream from the remote user.

The SDK triggers this callback when the user receives the data stream that another user sends by calling the sendStreamMessage method.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the user who sends the data stream.
  streamId | The ID of the stream data.
  data | The data stream.
  length | The length (byte) of the data stream.
  sentTs | The time when the data stream sent.

## ◆ onStreamMessageError() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamMessageError | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | int | streamId,
|  | int | code,
|  | int | missed,
|  | int | cached
| ) |  |
| virtual

Occurs when the local user does not receive the data stream from the remote user.

The SDK triggers this callback when the user fails to receive the data stream that another user sends by calling the sendStreamMessage method.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the user who sends the data stream.
  streamId | The ID of the stream data.
  code | The error code.
  missed | The number of lost messages.
  cached | The number of incoming cached messages when the data stream is interrupted.

## ◆ onRdtMessage() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRdtMessage | ( | const RtcConnection & | connection,
|  | uid_t | userId,
|  | RdtStreamType | type,
|  | const char * | data,
|  | size_t | length
| ) |  |
| virtual

Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user.

@technical preview

The SDK triggers this callback when the user receives the data stream that another user sends by calling the sendRdtMessage method.

Parameters

  connection | The RtcConnection object.
  userId | ID of the user who sends the data.
  type | The RDT stream type. See RdtStreamType.
  data | The data received.
  length | The length (byte) of the data.

## ◆ onRdtStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRdtStateChanged | ( | const RtcConnection & | connection,
|  | uid_t | userId,
|  | RdtState | state
| ) |  |
| virtual

Occurs when the RDT tunnel state changed.

@technical preview

Parameters

  connection | The RtcConnection object.
  userId | ID of the user who sends the data.
  state | The RDT tunnel state. See RdtState.

## ◆ onMediaControlMessage() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onMediaControlMessage | ( | const RtcConnection & | connection,
|  | uid_t | userId,
|  | const char * | data,
|  | size_t | length
| ) |  |
| virtual

Occurs when the local user receives media control message sent by a remote user.

@technical preview

The SDK triggers this callback when the user receives data sent by a remote user using the sendMediaControlMessage method.

Parameters

  connection | The RtcConnection object.
  userId | ID of the user who sends the data.
  data | The data received.
  length | The length (byte) of the data.

## ◆ onRequestToken() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRequestToken | ( | const RtcConnection & | connection | ) |
| virtual

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.

Upon receiving this callback, generate a new token at your app server and call `joinChannel` to pass the new token to the SDK.

Parameters

  connection | The RtcConnection object.

## ◆ onLicenseValidationFailure() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLicenseValidationFailure | ( | const RtcConnection & | connection,
|  | LICENSE_ERROR_TYPE | reason
| ) |  |
| virtual

Occurs when connection license verification fails.

You can know the reason accordding to error code

## ◆ onTokenPrivilegeWillExpire() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onTokenPrivilegeWillExpire | ( | const RtcConnection & | connection,
|  | const char * | token
| ) |  |
| virtual

Occurs when the token will expire 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 at your app server and call renewToken to pass the new Token to the SDK.

Parameters

  connection | The RtcConnection object.
  token | The token that will expire in 30 seconds.

## ◆ onFirstLocalAudioFramePublished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstLocalAudioFramePublished | ( | const RtcConnection & | connection,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the first local audio frame is published.

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

- The local client enables the audio module and calls `joinChannel` successfully.
- The local client calls `muteLocalAudioStream(true)` and `muteLocalAudioStream(false)` in sequence.
- The local client calls `disableAudio` and `enableAudio` in sequence.
- The local client calls `pushAudioFrame` to successfully push the audio frame to the SDK.

Parameters

  connection | The RtcConnection object.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel` to the SDK triggers this callback.

## ◆ onFirstRemoteAudioFrame() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteAudioFrame | ( | const RtcConnection & | connection,
|  | uid_t | userId,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the SDK receives the first audio frame from a specific remote user.

Deprecated:
  Use `onRemoteAudioStateChanged` instead.

Parameters

  connection | The RtcConnection object.
  userId | ID of the remote user.
  elapsed | The time elapsed (ms) from the loca user calling `joinChannel` until this callback is triggered.

## ◆ onFirstRemoteAudioDecoded() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteAudioDecoded | ( | const RtcConnection & | connection,
|  | uid_t | uid,
|  | int | elapsed
| ) |  |
| virtual

Occurs when the SDK decodes the first remote audio frame for playback.

Deprecated:
  Use `onRemoteAudioStateChanged` instead. The SDK triggers this callback under one of the following circumstances:
  - The remote user joins the channel and sends the audio stream for the first time.
  - The remote user's audio is offline and then goes online to re-send audio. It means the local user cannot receive audio in 15 seconds. Reasons for such an interruption include:
    - The remote user leaves channel.
    - The remote user drops offline.
    - The remote user calls muteLocalAudioStream to stop sending the audio stream.
    - The remote user calls disableAudio to disable audio.

Parameters

  connection | The RtcConnection object.
  uid | User ID of the remote user sending the audio stream.
  elapsed | The time elapsed (ms) from the loca user calling `joinChannel` until this callback is triggered.

## ◆ onLocalAudioStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalAudioStateChanged | ( | const RtcConnection & | connection,
|  | LOCAL_AUDIO_STREAM_STATE | state,
|  | LOCAL_AUDIO_STREAM_REASON | reason
| ) |  |
| virtual

Occurs when the local audio state changes.

When the state of the local audio stream changes (including the state of the audio capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local audio stream, and allows you to troubleshoot issues when audio exceptions occur.

Note
  When the state is `LOCAL_AUDIO_STREAM_STATE_FAILED(3)`, see the `error` parameter for details.

Parameters

  connection | The RtcConnection object.
  state | State of the local audio. See #LOCAL_AUDIO_STREAM_STATE.
  reason | The reason information of the local audio. See #LOCAL_AUDIO_STREAM_REASON.

## ◆ onRemoteAudioStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioStateChanged | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | REMOTE_AUDIO_STATE | state,
|  | REMOTE_AUDIO_STATE_REASON | reason,
|  | int | elapsed
| ) |  |
| virtual

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.

Note
  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.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the remote user whose audio state changes.
  state | State of the remote audio. See #REMOTE_AUDIO_STATE.
  reason | The reason of the remote audio state change. See #REMOTE_AUDIO_STATE_REASON.
  elapsed | Time elapsed (ms) from the local user calling the `joinChannel` method until the SDK triggers this callback.

## ◆ onActiveSpeaker() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onActiveSpeaker | ( | const RtcConnection & | connection,
|  | uid_t | uid
| ) |  |
| virtual

Occurs when an 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 is no less than two and an active remote speaker exists, the SDK triggers this callback and reports the uid of the most active remote speaker.

- If the most active remote speaker is always the same user, the SDK triggers the `onActiveSpeaker` callback only once.
- If the most active remote speaker changes to another user, the SDK triggers this callback again and reports the uid of the new active remote speaker.

Parameters

  connection | The RtcConnection object.
  uid | The ID of the active speaker. A `uid` of 0 means the local user.

## ◆ onClientRoleChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onClientRoleChanged | ( | const RtcConnection & | connection,
|  | CLIENT_ROLE_TYPE | oldRole,
|  | CLIENT_ROLE_TYPE | newRole,
|  | const ClientRoleOptions & | newRoleOptions
| ) |  |
| virtual

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

Parameters

  connection | The RtcConnection of the local user: #RtcConnection
  oldRole | The old role of the user: #CLIENT_ROLE_TYPE
  newRole | The new role of the user: #CLIENT_ROLE_TYPE
  newRoleOptions | The client role options of the new role: #ClientRoleOptions.

## ◆ onClientRoleChangeFailed() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onClientRoleChangeFailed | ( | const RtcConnection & | connection,
|  | CLIENT_ROLE_CHANGE_FAILED_REASON | reason,
|  | CLIENT_ROLE_TYPE | currentRole
| ) |  |
| virtual

Occurs when the user role in a Live-Broadcast channel fails to switch, for example, from a broadcaster to an audience or vice versa.

Parameters

  connection | The RtcConnection object.
  reason | The reason for failing to change the client role: #CLIENT_ROLE_CHANGE_FAILED_REASON.
  currentRole | The current role of the user: #CLIENT_ROLE_TYPE.

## ◆ onRemoteAudioTransportStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioTransportStats | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | unsigned short | delay,
|  | unsigned short | lost,
|  | unsigned short | rxKBitRate
| ) |  |
| virtual

Reports the transport-layer statistics of each remote audio stream.

Deprecated:
  Use `onRemoteAudioStats` instead.

This callback reports the transport-layer statistics, such as the packet loss rate and network time delay, once every two seconds after the local user receives an audio packet from a remote user. During a call, when the user receives the audio packet sent by the remote user/host, the callback is triggered every 2 seconds.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the remote user whose audio data packet is received.
  delay | The network time delay (ms) from the sender to the receiver.
  lost | The Packet loss rate (%) of the audio packet sent from the remote user.
  rxKBitRate | Received bitrate (Kbps) of the audio packet sent from the remote user.

## ◆ onRemoteVideoTransportStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoTransportStats | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | unsigned short | delay,
|  | unsigned short | lost,
|  | unsigned short | rxKBitRate
| ) |  |
| virtual

Reports the transport-layer statistics of each remote video stream.

Deprecated:
  Use `onRemoteVideoStats` instead.

This callback reports the transport-layer statistics, such as the packet loss rate and network time delay, once every two seconds after the local user receives a video packet from a remote user.

During a call, when the user receives the video packet sent by the remote user/host, the callback is triggered every 2 seconds.

Parameters

  connection | The RtcConnection object.
  remoteUid | ID of the remote user whose video packet is received.
  delay | The network time delay (ms) from the remote user sending the video packet to the local user.
  lost | The packet loss rate (%) of the video packet sent from the remote user.
  rxKBitRate | The bitrate (Kbps) of the video packet sent from the remote user.

## ◆ onConnectionStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionStateChanged | ( | const RtcConnection & | connection,
|  | CONNECTION_STATE_TYPE | state,
|  | CONNECTION_CHANGED_REASON_TYPE | reason
| ) |  |
| virtual

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.

Parameters

  connection | The RtcConnection object.
  state | The current connection state. See #CONNECTION_STATE_TYPE.
  reason | The reason for a connection state change. See #CONNECTION_CHANGED_REASON_TYPE.

## ◆ onNetworkTypeChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onNetworkTypeChanged | ( | const RtcConnection & | connection,
|  | NETWORK_TYPE | type
| ) |  |
| virtual

Occurs when the local network type changes.

This callback occurs when the connection state of the local user changes. You can get the connection state and reason for the state change in this callback. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.

Parameters

  connection | The RtcConnection object.
  type | The type of the local network connection. See #NETWORK_TYPE.

## ◆ onEncryptionError() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onEncryptionError | ( | const RtcConnection & | connection,
|  | ENCRYPTION_ERROR_TYPE | errorType
| ) |  |
| virtual

Reports the built-in encryption errors.

When encryption is enabled by calling `enableEncryption`, the SDK triggers this callback if an error occurs in encryption or decryption on the sender or the receiver side.

Parameters

  connection | The RtcConnection object.
  errorType | The error type. See #ENCRYPTION_ERROR_TYPE.

## ◆ onUploadLogResult() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUploadLogResult | ( | const RtcConnection & | connection,
|  | const char * | requestId,
|  | bool | success,
|  | UPLOAD_ERROR_REASON | reason
| ) |  |
| virtual

Reports the user log upload result

Parameters

  connection | The RtcConnection object.
  requestId | RequestId of the upload
  success | Is upload success
  reason | Reason of the upload, 0: OK, 1 Network Error, 2 Server Error.

## ◆ onUserAccountUpdated() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserAccountUpdated | ( | const RtcConnection & | connection,
|  | uid_t | remoteUid,
|  | const char * | remoteUserAccount
| ) |  |
| virtual

Occurs when the user account is updated.

Parameters

  connection | The RtcConnection object.
  remoteUid | The user ID.
  userAccount | The user account.

## ◆ onSnapshotTaken() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onSnapshotTaken | ( | const RtcConnection & | connection,
|  | uid_t | uid,
|  | const char * | filePath,
|  | int | width,
|  | int | height,
|  | int | errCode
| ) |  |
| virtual

Reports the result of taking a video snapshot.

After a successful `takeSnapshot` method call, the SDK triggers this callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.

Parameters

  connection | The RtcConnection object.
  uid | The user ID. A `uid` of 0 indicates the local user.
  filePath | The local path of the snapshot.
  width | The width (px) of the snapshot.
  height | The height (px) of the snapshot.
  errCode | The message that confirms success or gives the reason why the snapshot is not successfully taken: 0: Success. < 0: Failure. -1: The SDK fails to write data to a file or encode a JPEG image. -2: The SDK does not find the video stream of the specified user within one second after the `takeSnapshot` method call succeeds. -3: Calling the `takeSnapshot` method too frequently. Call the `takeSnapshot` method after receiving the `onSnapshotTaken` callback from the previous call.

## ◆ onVideoRenderingTracingResult() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onVideoRenderingTracingResult | ( | const RtcConnection & | connection,
|  | uid_t | uid,
|  | MEDIA_TRACE_EVENT | currentEvent,
|  | VideoRenderingTracingInfo | tracingInfo
| ) |  |
| virtual

Reports the tracing result of video rendering event of the user.

Parameters

  connection | The RtcConnection object.
  uid | The user ID.
  currentEvent | The current event of the tracing result: #MEDIA_TRACE_EVENT.
  tracingInfo | The tracing result: #VideoRenderingTracingInfo.

## ◆ onSetRtmFlagResult() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onSetRtmFlagResult | ( | const RtcConnection & | connection,
|  | int | code
| ) |  |
| virtual

Occurs when receive use rtm response.

Parameters

  connection | The RtcConnection object.
  code | The error code:

## ◆ onTranscodedStreamLayoutInfo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onTranscodedStreamLayoutInfo | ( | const RtcConnection & | connection,
|  | uid_t | uid,
|  | int | width,
|  | int | height,
|  | int | layoutCount,
|  | const VideoLayout * | layoutlist
| ) |  |
| virtual

Occurs when receive a video transcoder stream which has video layout info.

Parameters

  connection | The RtcConnection object.
  uid | user id of the transcoded stream.
  width | width of the transcoded stream.
  height | height of the transcoded stream.
  layoutCount | count of layout info in the transcoded stream.
  layoutlist | video layout info list of the transcoded stream.

## ◆ onAudioMetadataReceived() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioMetadataReceived | ( | const RtcConnection & | connection,
|  | uid_t | uid,
|  | const char * | metadata,
|  | size_t | length
| ) |  |
| virtual

The audio metadata received.

Parameters

  connection | The RtcConnection object.
  uid | ID of the remote user.
  metadata | The pointer of metadata
  length | Size of metadata @technical preview

## ◆ onMultipathStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onMultipathStats | ( | const RtcConnection & | connection,
|  | const MultipathStats & | stats
| ) |  |
| virtual

Callback for multipath transmission statistics.

Since
  4.6.0

Call timing: This callback is triggered after you set `enableMultipath` to `true` to enable multipath transmission.

Parameters

  stats | Multipath transmission statistics. See `MultipathStats`.

## ◆ onRenewTokenResult() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRenewTokenResult | ( | const RtcConnection & | connection,
|  | const char * | token,
|  | RENEW_TOKEN_ERROR_CODE | code
| ) |  |
| virtual

Occurs when a user renews the token.

This callback notifies the app that the user renews the token by calling `renewToken`. From this callback, the app can get the result of `renewToken`.

Parameters

  connection | The RtcConnection object.
  token | The token.
  code | The error code.

## ◆ onJoinChannelSuccess() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess

Occurs when a user joins a channel.

This callback notifies the application that a user joins a specified channel. Call timing: The SDK triggers this callback when you call `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)`, `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` , `joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount)`, `joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options)` , `joinChannelEx` or `joinChannelWithUserAccountEx` to join a channel.

Parameters

  channel | The channel name.
  uid | The ID of the user who joins the channel.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onRejoinChannelSuccess() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRejoinChannelSuccess

Occurs when a user rejoins the channel.

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

Parameters

  channel | The channel name.
  uid | The ID of the user who rejoins the channel.
  elapsed | Time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onAudioQuality() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioQuality

Reports the statistics of the audio stream sent by each remote user.

Deprecated:
  This callback is deprecated. Use onRemoteAudioStats instead.

The SDK triggers this callback once every two seconds to report the audio quality of each remote user who is sending an audio stream. If a channel has multiple users sending audio streams, the SDK triggers this callback as many times.

Parameters

  uid | The user ID of the remote user sending the audio stream.
  quality | Audio quality of the user. See `QUALITY_TYPE`.
  delay | The network delay (ms) from the sender to the receiver, including the delay caused by audio sampling pre-processing, network transmission, and network jitter buffering.
  lost | The packet loss rate (%) of the audio packet sent from the remote user to the receiver.

## ◆ onAudioVolumeIndication() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication

Reports the volume information of users.

By default, this callback is disabled. You can enable it by calling `enableAudioVolumeIndication`. Once this callback is enabled and users send streams in the channel, the SDK triggers the `onAudioVolumeIndication` callback according to the time interval set in `enableAudioVolumeIndication`. The SDK triggers two independent `onAudioVolumeIndication` callbacks simultaneously, which separately report the volume information of the local user who sends a stream and the remote users (up to three) whose instantaneous volume is the highest.

Note
  Once this callback is enabled, if the local user calls the `muteLocalAudioStream` method to mute, the SDK continues to report the volume indication of the local user. If a remote user whose volume is one of the three highest in the channel stops publishing the audio stream for 20 seconds, the callback excludes this user's information; if all remote users stop publishing audio streams for 20 seconds, the SDK stops triggering the callback for remote users.

Parameters

  speakers | The volume information of the users. See `AudioVolumeInfo`. An empty `speakers` array in the callback indicates that no remote user is in the channel or is sending a stream.
  speakerNumber | The total number of users. In the callback for the local user, if the local user is sending streams, the value of `speakerNumber` is 1. In the callback for remote users, the value range of `speakerNumber` is [0,3]. If the number of remote users who send streams is greater than or equal to three, the value of `speakerNumber` is 3.
  totalVolume | The volume of the speaker. The value range is [0,255]. In the callback for the local user, `totalVolume` is the volume of the local user who sends a stream. In the callback for remote users, `totalVolume` is the sum of the volume of all remote users (up to three) whose instantaneous volume is the highest. If the user calls `startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos)` , then `totalVolume` is the volume after audio mixing.

## ◆ onLeaveChannel() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLeaveChannel

Occurs when a user leaves a channel.

You can obtain information such as the total duration of a call, and the data traffic that the SDK transmits and receives. Call timing: The SDK triggers this callback after you call `leaveChannel()`, `leaveChannel(const LeaveChannelOptions& options)` , `leaveChannelEx(const RtcConnection& connection)`, or `leaveChannelEx(const RtcConnection& connection, const LeaveChannelOptions& options)` to leave a channel.

Parameters

  stats | Call statistics. See `RtcStats`.

## ◆ onRtcStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRtcStats

Reports the statistics about the current call.

Call timing: The SDK triggers this callback once every two seconds after the user joins the channel.

Parameters

  stats | Statistics of the RTC engine. See `RtcStats`.

## ◆ onNetworkQuality() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onNetworkQuality

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. This callback provides feedback on network quality through sending and receiving broadcast packets within the channel. Excessive broadcast packets can lead to broadcast storms. To prevent broadcast storms from causing a large amount of data transmission within the channel, this callback supports feedback on the network quality of up to 4 remote hosts simultaneously by default.

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

Parameters

  uid | The user ID. The network quality of the user with this user ID is reported. If the uid is 0, the local network quality is reported.
  txQuality | Uplink network quality rating of the user in terms of the transmission bit rate, packet loss rate, average RTT (Round-Trip Time) and jitter of the uplink network. This parameter is a quality rating helping you understand how well the current uplink network conditions can support the selected video encoder configuration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 640 × 480 and a frame rate of 15 fps in the LIVE_BROADCASTING profile, but might be inadequate for resolutions higher than 1280 × 720. See `QUALITY_TYPE`.
  rxQuality | Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. See `QUALITY_TYPE`.

## ◆ onIntraRequestReceived() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onIntraRequestReceived

Occurs when intra request from remote user is received.

This callback is triggered once remote user needs one Key frame.

## ◆ onFirstLocalVideoFramePublished() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalVideoFramePublished

Occurs when the first video frame is published.

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

- The local client enables the video module and calls `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)` or `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` to join the channel successfully.
- The local client calls `muteLocalVideoStream` (`true`) and `muteLocalVideoStream` (`false`) in sequence.
- The local client calls `disableVideo` and `enableVideo` in sequence.
- The local client calls `pushVideoFrame` to successfully push the video frame to the SDK.

Parameters

  source | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  elapsed | Time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)` or `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until this callback is triggered.

## ◆ onFirstRemoteVideoDecoded() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteVideoDecoded

Occurs when the first remote video frame is received and decoded.

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

- The remote user joins the channel and sends the video stream.
- The remote user stops sending the video stream and re-sends it after 15 seconds. Reasons for such an interruption include:
  - The remote user leaves the channel.
  - The remote user drops offline.
  - The remote user calls `disableVideo` to disable video.

Parameters

  uid | The user ID of the remote user sending the video stream.
  width | The width (px) of the video stream.
  height | The height (px) of the video stream.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)` or `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onVideoSizeChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onVideoSizeChanged

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

Parameters

  sourceType | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  uid | The ID of the user whose video size or rotation changes. (The `uid` for the local user is 0. The video is the local user's video preview).
  width | The width (pixels) of the video stream.
  height | The height (pixels) of the video stream.
  rotation | The rotation information. The value range is [0,360).Note: On the iOS platform, the parameter value is always 0.

## ◆ onLocalVideoStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged

Occurs when the local video stream state changes.

When the status of the local video changes, the SDK triggers this callback to report the current local video state and the reason for the state change. Applicable scenarios: You can use this callback to stay updated on the state changes of the local video stream, and take corresponding measures based on the reasons for the state changes, to better manage and debug issues related to the video stream. Call timing: - The SDK triggeres this callback under the following circumstances, with the `state` as LOCAL_VIDEO_STREAM_STATE_FAILED, and the `reason` as `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE`:

- The app switches to the background, and the system revokes the camera resource.
- For Android 9 and later versions, after an app is in the background for a period, the system automatically revokes camera permissions.
- For Android 6 and later versions, if the camera is held by a third-party app for a certain duration and then released, the SDK triggers this callback and reports the `onLocalVideoStateChanged` (`LOCAL_VIDEO_STREAM_STATE_CAPTURING,LOCAL_VIDEO_STREAM_REASON_OK`) callback.
- The camera starts normally, but does not output video frames for four consecutive seconds.

When the camera outputs captured video frames, if the SDK detects 15 consecutive duplicate video frames, it triggers this callback, with the `state` as `LOCAL_VIDEO_STREAM_STATE_CAPTURING` and the `reason` as `LOCAL_VIDEO_STREAM_REASON_CAPTURE_FAILURE`.Note:

- Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps.
- Normally, if there is an error in video capturing, the issue can be troubleshooted through the `reason` parameter in this callback. However, on some devices, when there is an issue with capturing (such as freezing), the Android system will not throw any error callbacks, so the SDK cannot report the reason for the change in local video status. In this case, you can determine if there is no video frame being captured by checking the following: this callback reports the `state` as `LOCAL_VIDEO_STREAM_STATE_CAPTURING` or `LOCAL_VIDEO_STREAM_STATE_ENCODING`, and the `captureFrameRate` in the `onLocalVideoStats` callback is 0.

Note
  - Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps.
  - Normally, if there is an error in video capturing, the issue can be troubleshooted through the `reason` parameter in this callback. However, on some devices, when there is an issue with capturing (such as freezing), the Android system will not throw any error callbacks, so the SDK cannot report the reason for the change in local video status. In this case, you can determine if there is no video frame being captured by checking the following: this callback reports the `state` as `LOCAL_VIDEO_STREAM_STATE_CAPTURING` or `LOCAL_VIDEO_STREAM_STATE_ENCODING`, and the `captureFrameRate` in the `onLocalVideoStats` callback is 0.

Parameters

  source | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  state | The state of the local video, see `LOCAL_VIDEO_STREAM_STATE`.
  reason | The reasons for changes in local video state. See `LOCAL_VIDEO_STREAM_REASON`.

## ◆ onRemoteVideoStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoStateChanged

Occurs when the remote video stream state changes.

Note
  This callback does not work properly when the number of users (in the communication profile) or hosts (in the live streaming channel) in a channel exceeds 32.

Parameters

  uid | The ID of the remote user whose video state changes.
  state | The state of the remote video. See `REMOTE_VIDEO_STATE`.
  reason | The reason for the remote video state change. See `REMOTE_VIDEO_STATE_REASON`.
  elapsed | Time elapsed (ms) from the local user calling the `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` method until the SDK triggers this callback.

## ◆ onFirstRemoteVideoFrame() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteVideoFrame

Occurs when the renderer receives the first frame of the remote video.

Note
  This callback is only triggered when the video frame is rendered by the SDK; it will not be triggered if the user employs custom video rendering.You need to implement this independently using methods outside the SDK.

Parameters

  uid | The user ID of the remote user sending the video stream.
  width | The width (px) of the video stream.
  height | The height (px) of the video stream.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)` or `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onUserJoined() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserJoined

Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) 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 co-hosts to 32, with a maximum of 17 video hosts. Call timing: The SDK triggers this callback under one of the following circumstances:
- A remote user/host joins the channel.
- 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.

Parameters

  uid | The ID of the user or host who joins the channel.
  elapsed | Time delay (ms) from the local user calling `joinChannel(const char* token, const char* channelId, const char* info, uid_t uid)` or `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until this callback is triggered.

## ◆ onUserOffline() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserOffline

Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.

There are generally two reasons for users to become offline:

- Leave the channel: When a user/host leaves the channel, the user/host sends a goodbye message.
- 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 is recommended to use the Agora RTM SDK for reliable offline detection. Call timing: This callback is triggered when a remote user (in the communication profile) or host (in the live streaming profile) leaves a channel.

Parameters

  uid | The ID of the user who leaves the channel or goes offline.
  reason | Reasons why a remote user (in the communication profile) or host (in the live streaming profile) goes offline. See `USER_OFFLINE_REASON_TYPE`.

## ◆ onUserMuteAudio() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserMuteAudio

Occurs when a remote user (in the communication profile) or a host (in the live streaming profile) stops/resumes sending the audio stream.

The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the `muteLocalAudioStream` method.

Note
  This callback does not work properly when the number of users (in the communication profile) or hosts (in the live streaming channel) in a channel exceeds 32.

Parameters

  uid | The user ID.
  muted | Whether the remote user's audio stream is muted: `true`: User's audio stream is muted. `false`: User's audio stream is unmuted.

## ◆ onUserMuteVideo() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserMuteVideo

Occurs when a remote user stops or resumes publishing the video stream.

When a remote user calls `muteLocalVideoStream` to stop or resume publishing the video stream, the SDK triggers this callback to report to the local user the state of the streams published by the remote user.

Note
  This callback can be inaccurate when the number of users (in the communication profile) or hosts (in the live streaming profile) in a channel exceeds 32.

Parameters

  uid | The user ID of the remote user.
  muted | Whether the remote user stops publishing the video stream: `true`: The remote user stops publishing the video stream. `false`: The remote user resumes publishing the video stream.

## ◆ onUserEnableVideo() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserEnableVideo

Occurs when a remote user enables or disables the video module.

Once the video module is disabled, the user can only use a voice call. The user cannot send or receive any video. The SDK triggers this callback when a remote user enables or disables the video module by calling the `enableVideo` or `disableVideo` method.

Parameters

  uid | The user ID of the remote user.
  enabled | `true`: The video module is enabled.

- `false`: The video module is disabled.

## ◆ onUserEnableLocalVideo() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserEnableLocalVideo

Occurs when a specific remote user enables/disables the local video capturing function.

The SDK triggers this callback when the remote user resumes or stops capturing the video stream by calling the `enableLocalVideo` method.

Parameters

  uid | The user ID of the remote user.
  enabled | Whether the specified remote user enables/disables local video capturing: `true`: The video module is enabled. Other users in the channel can see the video of this remote user. `false`: The video module is disabled. Other users in the channel can no longer receive the video stream from this remote user, while this remote user can still receive the video streams from other users.

## ◆ onUserStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserStateChanged

Occurs when the remote user audio or video state is updated.

Parameters

  uid | The uid of the remote user.
  state | The remote user's audio or video state: #REMOTE_USER_STATE.

## ◆ onLocalAudioStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLocalAudioStats

Reports the statistics of the local audio stream.

The SDK triggers this callback once every two seconds.

Parameters

  stats | Local audio statistics. See `LocalAudioStats`.

## ◆ onRemoteAudioStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioStats

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.

Parameters

  stats | The statistics of the received remote audio streams. See `RemoteAudioStats`.

## ◆ onLocalVideoStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStats

Reports the statistics of the local video stream.

The SDK triggers this callback once every two seconds to report the statistics of the local video stream.

Parameters

  source | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  stats | The statistics of the local video stream. See `LocalVideoStats`.

## ◆ onRemoteVideoStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoStats

Reports the statistics of the video stream sent by each remote users.

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.

Parameters

  stats | Statistics of the remote video stream. See `RemoteVideoStats`.

## ◆ onConnectionLost() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionLost

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(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` method, regardless of whether it is in the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.

## ◆ onConnectionInterrupted() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted

Occurs when the connection between the SDK and the server is interrupted.

Deprecated:
  Use `onConnectionStateChanged` instead.

The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. You can use this callback to implement pop-up reminders. The differences between this callback and `onConnectionLost` are as follow:

- The SDK triggers the `onConnectionInterrupted` callback when it loses connection with the server for more than four seconds after it successfully joins the channel.
- The SDK triggers the `onConnectionLost` callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.

## ◆ onConnectionBanned() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionBanned

Occurs when the connection is banned by the Agora server.

Deprecated:
  Use `onConnectionStateChanged` instead.

## ◆ onStreamMessage() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onStreamMessage

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.

Note
  If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use `Signaling`.

Parameters

  uid | The ID of the remote user sending the message.
  streamId | The stream ID of the received message.
  data | The data received.
  length | The data length (byte).
  sentTs | The time when the data stream is sent.

## ◆ onStreamMessageError() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onStreamMessageError

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.

Note
  If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use `Signaling`.

Parameters

  uid | The ID of the remote user sending the message.
  streamId | The stream ID of the received message.
  code | Error code.
  missed | The number of lost messages.
  cached | Number of incoming cached messages when the data stream is interrupted.

## ◆ onRdtMessage() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRdtMessage

Occurs when the local user receives data via Reliable Data Transmission (RDT) from a remote user.

@technical preview

The SDK triggers this callback when the user receives the data stream that another user sends by calling the sendRdtMessage method.

Parameters

  userId | ID of the user who sends the data.
  type | The RDT stream type. See RdtStreamType.
  data | The data received.
  length | The length (byte) of the data.

## ◆ onRdtStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRdtStateChanged

Occurs when the RDT tunnel state changed.

@technical preview

Parameters

  userId | ID of the user who sends the data.
  state | The RDT tunnel state. See RdtState.

## ◆ onMediaControlMessage() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onMediaControlMessage

Occurs when the local user receives media control message sent by a remote user.

@technical preview

The SDK triggers this callback when the user receives data sent by a remote user using the sendMediaControlMessage method.

Parameters

  userId | ID of the user who sends the data.
  data | The data received.
  length | The length (byte) of the data.

## ◆ onRequestToken() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRequestToken

Occurs when the token expires.

The SDK triggers this callback if the token expires. When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:

- In scenarios involving one channel:
  - Call `renewToken` to pass in the new token.
  - Call `leaveChannel(const LeaveChannelOptions& options)` to leave the current channel and then pass in the new token when you call `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` to join a channel.
- In scenarios involving mutiple channels: Call `updateChannelMediaOptionsEx` to pass in the new token.

## ◆ onTokenPrivilegeWillExpire() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onTokenPrivilegeWillExpire

Occurs when the token expires in 30 seconds.

When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:

- In scenarios involving one channel:
  - Call `renewToken` to pass in the new token.
  - Call `leaveChannel(const LeaveChannelOptions& options)` to leave the current channel and then pass in the new token when you call `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` to join a channel.
- In scenarios involving mutiple channels: Call `updateChannelMediaOptionsEx` to pass in the new token. Call timing: The SDK triggers this callback 30 seconds before the token expires, reminding the app to update the token.

Parameters

  token | The token that is about to expire.

## ◆ onLicenseValidationFailure() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLicenseValidationFailure

Occurs when connection license verification fails.

You can know the reason accordding to error code

## ◆ onFirstLocalAudioFramePublished() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalAudioFramePublished

Occurs when the first audio frame is published.

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

- The local client enables the audio module and calls `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` successfully.
- The local client calls `muteLocalAudioStream` (`true`) and `muteLocalAudioStream` (`false`) in sequence.
- The local client calls `disableAudio` and `enableAudio` in sequence.
- The local client calls `pushAudioFrame` to successfully push the audio frame to the SDK.

Parameters

  elapsed | Time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onFirstRemoteAudioFrame() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteAudioFrame

Occurs when the SDK receives the first audio frame from a specific remote user.

Deprecated:
  Use `onRemoteAudioStateChanged` instead.

Parameters

  uid | The user ID of the remote user.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onFirstRemoteAudioDecoded() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteAudioDecoded

Occurs when the SDK decodes the first remote audio frame for playback.

Deprecated:
  Use `onRemoteAudioStateChanged` instead.

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

- The remote user joins the channel and sends the audio stream for the first time.
- The remote user's audio is offline and then goes online to re-send audio. It means the local user cannot receive audio in 15 seconds. Reasons for such an interruption include:
  - The remote user leaves channel.
  - The remote user drops offline.
  - The remote user calls `muteLocalAudioStream` to stop sending the audio stream.
  - The remote user calls `disableAudio` to disable audio.

Parameters

  uid | The user ID of the remote user.
  elapsed | The time elapsed (ms) from the local user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until the SDK triggers this callback.

## ◆ onLocalAudioStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLocalAudioStateChanged

Occurs when the local audio stream state changes.

When the state of the local audio stream changes (including the state of the audio capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local audio stream, and allows you to troubleshoot issues when audio exceptions occur.

Note
  When the state is `LOCAL_AUDIO_STREAM_STATE_FAILED` (3), you can view the error information in the `error` parameter.

Parameters

  state | The state of the local audio. See `LOCAL_AUDIO_STREAM_STATE`.
  reason | Reasons for local audio state changes. See `LOCAL_AUDIO_STREAM_REASON`.

## ◆ onRemoteAudioStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioStateChanged

Occurs when the remote audio state changes.

When the audio state of a remote user (in a voice/video call channel) or host (in a live streaming channel) changes, the SDK triggers this callback to report the current state of the remote audio stream.

Note
  This callback does not work properly when the number of users (in the communication profile) or hosts (in the live streaming channel) in a channel exceeds 32.

Parameters

  uid | The ID of the remote user whose audio state changes.
  state | The state of the remote audio. See `REMOTE_AUDIO_STATE`.
  reason | The reason of the remote audio state change. See `REMOTE_AUDIO_STATE_REASON`.
  elapsed | Time elapsed (ms) from the local user calling the `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` method until the SDK triggers this callback.

## ◆ onActiveSpeaker() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onActiveSpeaker

Occurs when the most active remote 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 whose volume is detected as the loudest for the most times, is the most active user. When the number of users is no less than two and an active remote speaker exists, the SDK triggers this callback and reports the `uid` of the most active remote speaker.

- If the most active remote speaker is always the same user, the SDK triggers the `onActiveSpeaker` callback only once.
- If the most active remote speaker changes to another user, the SDK triggers this callback again and reports the `uid` of the new active remote speaker.

Parameters

  uid | The user ID of the most active speaker.

## ◆ onClientRoleChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onClientRoleChanged

Occurs when the user role or the audience latency level changes.

Call timing: This callback will be triggered in any of the following situations:

- Calling `setClientRole(CLIENT_ROLE_TYPE role)` or `setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options)` to set the user role or audience latency level after joining a channel
- Calling `setClientRole(CLIENT_ROLE_TYPE role)` or `setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options)` and set the user role to `AUDIENCE` before joining a channel.

Note
  This callback will not be triggered when you call `setClientRole(CLIENT_ROLE_TYPE role)` or `setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options)` and set the user role to `BROADCASTER` before joining a channel.

Parameters

  oldRole | Role that the user switches from: `CLIENT_ROLE_TYPE`.
  newRole | Role that the user switches to: `CLIENT_ROLE_TYPE`.
  newRoleOptions | Since v4.1.0 Properties of the role that the user switches to. See `ClientRoleOptions`.

## ◆ onClientRoleChangeFailed() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onClientRoleChangeFailed

Occurs when switching a user role fails.

This callback informs you about the reason for failing to switching and your current user role. Call timing: The SDK triggers this callback when the local user calls `setClientRole(CLIENT_ROLE_TYPE role)` or `setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options)` after joining a channel to switch the user role but the switching fails.

Parameters

  reason | The reason for a user role switch failure. See `CLIENT_ROLE_CHANGE_FAILED_REASON`.
  currentRole | Current user role. See `CLIENT_ROLE_TYPE`.

## ◆ onRemoteAudioTransportStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioTransportStats

Reports the transport-layer statistics of each remote audio stream.

Deprecated:
  Use `onRemoteAudioStats` instead.

This callback reports the transport-layer statistics, such as the packet loss rate and network time delay after the local user receives an audio packet from a remote user. During a call, when the user receives the audio packet sent by the remote user, the callback is triggered every 2 seconds.

Parameters

  uid | The ID of the remote user sending the audio streams.
  delay | The network delay (ms) from the remote user to the receiver.
  lost | The packet loss rate (%) of the audio packet sent from the remote user to the receiver.
  rxKBitrate | The bitrate of the received audio (Kbps).

## ◆ onRemoteVideoTransportStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoTransportStats

Reports the transport-layer statistics of each remote video stream.

Deprecated:
  Use `onRemoteVideoStats` instead.

This callback reports the transport-layer statistics, such as the packet loss rate and network time delay after the local user receives a video packet from a remote user. During a call, when the user receives the video packet sent by the remote user/host, the callback is triggered every 2 seconds.

Parameters

  uid | The ID of the remote user sending the video packets.
  delay | The network delay (ms) from the sender to the receiver.
  lost | The packet loss rate (%) of the video packet sent from the remote user.
  rxKBitRate | The bitrate of the received video (Kbps).

## ◆ onConnectionStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged

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.

Parameters

  state | The current connection state. See `CONNECTION_STATE_TYPE`.
  reason | The reason for a connection state change. See `CONNECTION_CHANGED_REASON_TYPE`.

## ◆ onNetworkTypeChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onNetworkTypeChanged

Occurs when the local network type changes.

This callback occurs when the connection state of the local user changes. You can get the connection state and reason for the state change in this callback. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.

Parameters

  type | The type of the local network connection. See `NETWORK_TYPE`.

## ◆ onEncryptionError() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onEncryptionError

Reports the built-in encryption errors.

When encryption is enabled by calling `enableEncryption`, the SDK triggers this callback if an error occurs in encryption or decryption on the sender or the receiver side.

Parameters

  errorType | Details about the error type. See `ENCRYPTION_ERROR_TYPE`.

## ◆ onUploadLogResult() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUploadLogResult

Reports the user log upload result

Parameters

  requestId | RequestId of the upload
  success | Is upload success
  reason | Reason of the upload, 0: OK, 1 Network Error, 2 Server Error.

## ◆ onUserInfoUpdated()

virtual void agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated

Occurs when the SDK gets the user ID and user account of the remote user.

After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object, and triggers this callback on the local client.

Parameters

  uid | The user ID of the remote user.
  info | The UserInfo object that contains the user ID and user account of the remote user. See `UserInfo` for details.

## ◆ onUserAccountUpdated() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onUserAccountUpdated

Occurs when the user account is updated.

Parameters

  uid | The user ID.
  userAccount | The user account.

## ◆ onAudioSubscribeStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioSubscribeStateChanged

Occurs when the audio subscribing state changes.

Parameters

  channel | The channel name.
  uid | The user ID of the remote user.
  oldState | The previous subscribing status. See `STREAM_SUBSCRIBE_STATE`.
  newState | The current subscribing status. See `STREAM_SUBSCRIBE_STATE`.
  elapseSinceLastState | The time elapsed (ms) from the previous state to the current state.

## ◆ onVideoSubscribeStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoSubscribeStateChanged

Occurs when the video subscribing state changes.

Parameters

  channel | The channel name.
  uid | The user ID of the remote user.
  oldState | The previous subscribing status. See `STREAM_SUBSCRIBE_STATE`.
  newState | The current subscribing status. See `STREAM_SUBSCRIBE_STATE`.
  elapseSinceLastState | The time elapsed (ms) from the previous state to the current state.

## ◆ onAudioPublishStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioPublishStateChanged

Occurs when the audio publishing state changes.

Parameters

  channel | The channel name.
  oldState | The previous publishing state. See `STREAM_PUBLISH_STATE`.
  newState | The current publishing stat. See `STREAM_PUBLISH_STATE`.
  elapseSinceLastState | The time elapsed (ms) from the previous state to the current state.

## ◆ onVideoPublishStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoPublishStateChanged

Occurs when the video publishing state changes.

Parameters

  channel | The channel name.
  source | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  oldState | The previous publishing state. See `STREAM_PUBLISH_STATE`.
  newState | The current publishing stat. See `STREAM_PUBLISH_STATE`.
  elapseSinceLastState | The time elapsed (ms) from the previous state to the current state.

## ◆ onSnapshotTaken() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onSnapshotTaken

Reports the result of taking a video snapshot.

After a successful `takeSnapshot(uid_t uid, const char* filePath)` method call, the SDK triggers this callback to report whether the snapshot is successfully taken as well as the details for the snapshot taken.

Parameters

  uid | The user ID. One `uid` of 0 indicates the local user.
  filePath | The local path of the snapshot.
  width | The width (px) of the snapshot.
  height | The height (px) of the snapshot.
  errCode | The message that confirms success or gives the reason why the snapshot is not successfully taken: 0: Success. < 0: Failure: -1: The SDK fails to write data to a file or encode a JPEG image. -2: The SDK does not find the video stream of the specified user within one second after the `takeSnapshot(uid_t uid, const char* filePath)` method call succeeds. The possible reasons are: local capture stops, remote end stops publishing, or video data processing is blocked. -3: Calling the `takeSnapshot(uid_t uid, const char* filePath)` method too frequently.

## ◆ onVideoRenderingTracingResult() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onVideoRenderingTracingResult

Video frame rendering event callback.

After calling the `startMediaRenderingTracing` method or joining a channel, the SDK triggers this callback to report the events of video frame rendering and the indicators during the rendering process. Developers can optimize the indicators to improve the efficiency of the first video frame rendering.

Parameters

  uid | The user ID.
  currentEvent | The current video frame rendering event. See `MEDIA_TRACE_EVENT`.
  tracingInfo | The indicators during the video frame rendering process. Developers need to reduce the value of indicators as much as possible in order to improve the efficiency of the first video frame rendering. See `VideoRenderingTracingInfo`.

## ◆ onSetRtmFlagResult() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onSetRtmFlagResult

Occurs when the SDK receives RTM setting change response.

@technical preview

Parameters

  code | The error code.

## ◆ onTranscodedStreamLayoutInfo() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onTranscodedStreamLayoutInfo

Occurs when the local user receives a mixed video stream carrying layout information.

When the local user receives a mixed video stream sent by the video mixing server for the first time, or when there is a change in the layout information of the mixed stream, the SDK triggers this callback, reporting the layout information of each sub-video stream within the mixed video stream.

Note
  This callback is for Android and iOS only.

Parameters

  uid | User ID who published this mixed video stream.
  width | Width (px) of the mixed video stream.
  height | Heitht (px) of the mixed video stream.
  layoutCount | The number of layout information in the mixed video stream.
  layoutlist | Layout information of a specific sub-video stream within the mixed stream. See `VideoLayout`.

## ◆ onAudioMetadataReceived() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMetadataReceived

Occurs when the SDK receives audio metadata.

Since
  v4.3.1

Parameters

  uid | ID of the remote user.
  metadata | The pointer of metadata
  length | Size of metadata @technical preview

## ◆ onMultipathStats() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onMultipathStats

Report the multipath transmission statistics.

Postcondition
  This callback is triggered after you set `enableMultipath` to `true` to enable multipath transmission.

Since
  4.6.0

Parameters

  stats | The multipath statistics. See the MultipathStats structure for details.

## ◆ onRenewTokenResult() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRenewTokenResult

Callback for `renewToken` call result.

Since
  4.6.0

This callback is triggered after the user calls the `renewToken` method to update the token, and is used to notify the app of the result.

Parameters

  token | Token.
  code | Error code. See `RENEW_TOKEN_ERROR_CODE`.