Public Member Functions

virtual ~IRtcEngineEventHandler ()
 
virtual void onWarning (int warn, const char *msg)
 
virtual void onError (int err, const char *msg)
 
virtual void onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onLeaveChannel (const RtcStats &stats)
 
virtual void onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole)
 
virtual void onUserJoined (uid_t uid, int elapsed)
 
virtual void onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason)
 
virtual void onLastmileQuality (int quality)
 
virtual void onLastmileProbeResult (const LastmileProbeResult &result)
 
virtual void onConnectionInterrupted ()
 
virtual void onConnectionLost ()
 
virtual void onConnectionBanned ()
 
virtual void onApiCallExecuted (int err, const char *api, const char *result)
 
virtual void onRequestToken ()
 
virtual void onTokenPrivilegeWillExpire (const char *token)
 
virtual void onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost)
 
virtual void onRtcStats (const RtcStats &stats)
 
virtual void onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
 
virtual void onLocalVideoStats (const LocalVideoStats &stats)
 
virtual void onRemoteVideoStats (const RemoteVideoStats &stats)
 
virtual void onLocalAudioStats (const LocalAudioStats &stats)
 
virtual void onRemoteAudioStats (const RemoteAudioStats &stats)
 
virtual void onLocalAudioStateChanged (LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error)
 
virtual void onRemoteAudioStateChanged (uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
 
virtual void onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
 
virtual void onActiveSpeaker (uid_t uid)
 
virtual void onVideoStopped ()
 
virtual void onFirstLocalVideoFrame (int width, int height, int elapsed)
 
virtual void onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed)
 
virtual void onFirstRemoteVideoFrame (uid_t uid, int width, int height, int elapsed)
 
virtual void onUserMuteAudio (uid_t uid, bool muted)
 
virtual void onUserMuteVideo (uid_t uid, bool muted)
 
virtual void onUserEnableVideo (uid_t uid, bool enabled)
 
virtual void onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
 
virtual void onAudioDeviceVolumeChanged (MEDIA_DEVICE_TYPE deviceType, int volume, bool muted)
 
virtual void onCameraReady ()
 
virtual void onCameraFocusAreaChanged (int x, int y, int width, int height)
 
virtual void onFacePositionChanged (int imageWidth, int imageHeight, Rectangle *vecRectangle, int *vecDistance, int numFaces)
 
virtual void onCameraExposureAreaChanged (int x, int y, int width, int height)
 
virtual void onAudioMixingFinished ()
 
virtual void onAudioMixingStateChanged (AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode)
 
virtual void onRemoteAudioMixingBegin ()
 
virtual void onRemoteAudioMixingEnd ()
 
virtual void onAudioEffectFinished (int soundId)
 
virtual void onFirstRemoteAudioDecoded (uid_t uid, int elapsed)
 
virtual void onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
 
virtual void onLocalVideoStateChanged (LOCAL_VIDEO_STREAM_STATE localVideoState, LOCAL_VIDEO_STREAM_ERROR error)
 
virtual void onVideoSizeChanged (uid_t uid, int width, int height, int rotation)
 
virtual void onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
 
virtual void onUserEnableLocalVideo (uid_t uid, bool enabled)
 
virtual void onStreamMessage (uid_t uid, int streamId, const char *data, size_t length)
 
virtual void onStreamMessageError (uid_t uid, int streamId, int code, int missed, int cached)
 
virtual void onMediaEngineLoadSuccess ()
 
virtual void onMediaEngineStartCallSuccess ()
 
virtual void onChannelMediaRelayStateChanged (CHANNEL_MEDIA_RELAY_STATE state, CHANNEL_MEDIA_RELAY_ERROR code)
 
virtual void onChannelMediaRelayEvent (CHANNEL_MEDIA_RELAY_EVENT code)
 
virtual void onFirstLocalAudioFrame (int elapsed)
 
virtual void onFirstRemoteAudioFrame (uid_t uid, int elapsed)
 
virtual void onRtmpStreamingStateChanged (const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode)
 
virtual void onStreamPublished (const char *url, int error)
 
virtual void onStreamUnpublished (const char *url)
 
virtual void onTranscodingUpdated ()
 
virtual void onStreamInjectedStatus (const char *url, uid_t uid, int status)
 
virtual void onAudioRouteChanged (AUDIO_ROUTE_TYPE routing)
 
virtual void onLocalPublishFallbackToAudioOnly (bool isFallbackOrRecover)
 
virtual void onRemoteSubscribeFallbackToAudioOnly (uid_t uid, bool isFallbackOrRecover)
 
virtual void onRemoteAudioTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate)
 
virtual void onRemoteVideoTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate)
 
virtual void onMicrophoneEnabled (bool enabled)
 
virtual void onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
 
virtual void onNetworkTypeChanged (NETWORK_TYPE type)
 
virtual void onLocalUserRegistered (uid_t uid, const char *userAccount)
 
virtual void onUserInfoUpdated (uid_t uid, const UserInfo &info)
 

Detailed Description

The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application. The application inherits the methods of this interface class to retrieve these callbacks.

All methods in this interface class have default (empty) implementations. Therefore, the application can only inherit some required events. In the callbacks, avoid time-consuming tasks or calling blocking APIs, such as the SendMessage method. Otherwise, the SDK may not work properly.

Constructor & Destructor Documentation

◆ ~IRtcEngineEventHandler()

virtual agora::rtc::IRtcEngineEventHandler::~IRtcEngineEventHandler ( )
inlinevirtual

Member Function Documentation

◆ onWarning()

virtual void agora::rtc::IRtcEngineEventHandler::onWarning ( int  warn,
const char *  msg 
)
inlinevirtual

Reports a warning during SDK runtime.

In most cases, the application can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. For example, when losing connection with the server, the SDK may report WARN_LOOKUP_CHANNEL_TIMEOUT and automatically try to reconnect.

Parameters
warnWarning code: WARN_CODE_TYPE.
msgPointer to the warning message.

◆ onError()

virtual void agora::rtc::IRtcEngineEventHandler::onError ( int  err,
const char *  msg 
)
inlinevirtual

Reports an error during SDK runtime.

In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.

For example, the SDK reports an ERR_START_CALL error when failing to initialize a call. The application informs the user that the call initialization failed and invokes the leaveChannel method to leave the channel.

Parameters
errError code: ERROR_CODE_TYPE.
msgPointer to the error message.

◆ onJoinChannelSuccess()

virtual void agora::rtc::IRtcEngineEventHandler::onJoinChannelSuccess ( const char *  channel,
uid_t  uid,
int  elapsed 
)
inlinevirtual

Occurs when a user joins a channel.

This callback notifies the application that a user joins a specified channel when the application calls the joinChannel method.

The channel name assignment is based on channelName specified in the joinChannel method.

If the uid is not specified in the joinChannel method, the server automatically assigns a uid.

Parameters
channelPointer to the channel name.
uidUser ID of the user joining the channel.
elapsedTime elapsed (ms) from the user calling the joinChannel method until the SDK triggers this callback.

◆ onRejoinChannelSuccess()

virtual void agora::rtc::IRtcEngineEventHandler::onRejoinChannelSuccess ( const char *  channel,
uid_t  uid,
int  elapsed 
)
inlinevirtual

Occurs when a user rejoins the channel after disconnection due to network problems.

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
channelPointer to the channel name.
uidUser ID of the user rejoining the channel.
elapsedTime elapsed (ms) from starting to reconnect until the SDK triggers this callback.

◆ onLeaveChannel()

virtual void agora::rtc::IRtcEngineEventHandler::onLeaveChannel ( const RtcStats stats)
inlinevirtual

Occurs when a user leaves the channel.

This callback notifies the application that a user leaves the channel when the application calls the leaveChannel method.

The application retrieves information, such as the call duration and statistics.

Parameters
statsPointer to the statistics of the call: RtcStats.

◆ onClientRoleChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onClientRoleChanged ( CLIENT_ROLE_TYPE  oldRole,
CLIENT_ROLE_TYPE  newRole 
)
inlinevirtual

Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa.

This callback notifies the application of a user role switch when the application calls the setClientRole method.

The SDK triggers this callback when the local user switches the user role by calling the setClientRole method after joining the channel.

Parameters
oldRoleRole that the user switches from: CLIENT_ROLE_TYPE.
newRoleRole that the user switches to: CLIENT_ROLE_TYPE.

◆ onUserJoined()

virtual void agora::rtc::IRtcEngineEventHandler::onUserJoined ( uid_t  uid,
int  elapsed 
)
inlinevirtual

Occurs when a remote user (Communication)/ host (Live Broadcast) joins the channel.

  • Communication profile: This callback notifies the application that another user joins the channel. If other users are already in the channel, the SDK also reports to the application on the existing users.
  • Live-broadcast profile: This callback notifies the application that the host joins the channel. If other hosts are already in the channel, the SDK also reports to the application on the existing hosts. We recommend 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 by calling the setClientRole method after joining the channel.
  • A remote user/host rejoins the channel after a network interruption.
  • The host injects an online media stream into the channel by calling the addInjectStreamUrl method.
Note
In the Live-broadcast profile:
  • The host receives this callback when another host joins the channel.
  • The audience in the channel receives this callback when a new host joins the channel.
  • When a web application joins the channel, the SDK triggers this callback as long as the web application publishes streams.
Parameters
uidUser ID of the user or host joining the channel.
elapsedTime delay (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onUserOffline()

virtual void agora::rtc::IRtcEngineEventHandler::onUserOffline ( uid_t  uid,
USER_OFFLINE_REASON_TYPE  reason 
)
inlinevirtual

Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel.

Reasons why the user is offline:

  • Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When the message is received, the SDK assumes that the user/host leaves the channel.
  • Drop offline: When no data packet of the user or host is received for a certain period of time, the SDK assumes that the user/host drops offline. Unreliable network connections may lead to false detections, so we recommend using the Agora RTM SDK for more reliable offline detection.
Parameters
uidUser ID of the user leaving the channel or going offline.
reasonReason why the user is offline: USER_OFFLINE_REASON_TYPE.

◆ onLastmileQuality()

virtual void agora::rtc::IRtcEngineEventHandler::onLastmileQuality ( int  quality)
inlinevirtual

Reports the last mile network quality of the local user once every two seconds before the user joins the channel.

Last mile refers to the connection between the local device and Agora's edge server. After the application calls the enableLastmileTest method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel.

Parameters
qualityThe last mile network quality: QUALITY_TYPE.

◆ onLastmileProbeResult()

virtual void agora::rtc::IRtcEngineEventHandler::onLastmileProbeResult ( const LastmileProbeResult result)
inlinevirtual

Reports the last-mile network probe result.

The SDK triggers this callback within 30 seconds after the app calls the startLastmileProbeTest method.

Parameters
resultThe uplink and downlink last-mile network probe test result. See LastmileProbeResult.

◆ onConnectionInterrupted()

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionInterrupted ( )
inlinevirtual

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

Deprecated as of v2.3.2. Replaced by the onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED) callback.

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 reconnecting to the server. You can use this callback to implement pop-up reminders.

This callback is different from onConnectionLost:

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

◆ onConnectionLost()

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionLost ( )
inlinevirtual

Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.

The SDK triggers this callback when it cannot connect to the server 10 seconds after calling the joinChannel method, whether or not it is in the channel.

This callback is different from onConnectionInterrupted:

  • 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()

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionBanned ( )
inlinevirtual

DEPRECATED Deprecated as of v2.3.2. Replaced by the onConnectionStateChanged(CONNECTION_STATE_FAILED, CONNECTION_CHANGED_BANNED_BY_SERVER) callback.

Occurs when your connection is banned by the Agora Server.

◆ onApiCallExecuted()

virtual void agora::rtc::IRtcEngineEventHandler::onApiCallExecuted ( int  err,
const char *  api,
const char *  result 
)
inlinevirtual

Occurs when a method is executed by the SDK.

Parameters
errThe error code (ERROR_CODE_TYPE) returned by the SDK when a method call fails. If the SDK returns 0, then the method call is successful.
apiPointer to the method executed by the SDK.
resultPointer to the result of the method call.

◆ onRequestToken()

virtual void agora::rtc::IRtcEngineEventHandler::onRequestToken ( )
inlinevirtual

Occurs when the token expires.

After a token is specified by calling the joinChannel method, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server.

This callback notifies the app to generate a new token and call joinChannel to rejoin the channel with the new token.

◆ onTokenPrivilegeWillExpire()

virtual void agora::rtc::IRtcEngineEventHandler::onTokenPrivilegeWillExpire ( const char *  token)
inlinevirtual

Occurs when the token expires in 30 seconds.

The user becomes offline if the token used in the joinChannel method expires. The SDK triggers this callback 30 seconds before the token expires to remind the application to get a new token. Upon receiving this callback, generate a new token on the server and call the renewToken method to pass the new token to the SDK.

Parameters
tokenPointer to the token that expires in 30 seconds.

◆ onAudioQuality()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioQuality ( uid_t  uid,
int  quality,
unsigned short  delay,
unsigned short  lost 
)
inlinevirtual

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

Deprecated as of v2.3.2. Use the onRemoteAudioStats callback 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 users/hosts sending audio streams, the SDK triggers this callback as many times.

Parameters
uidUser ID of the speaker.
qualityAudio quality of the user: QUALITY_TYPE.
delayTime delay (ms) of sending the audio packet from the sender to the receiver, including the time delay of audio sampling pre-processing, transmission, and the jitter buffer.
lostPacket loss rate (%) of the audio packet sent from the sender to the receiver.

◆ onRtcStats()

virtual void agora::rtc::IRtcEngineEventHandler::onRtcStats ( const RtcStats stats)
inlinevirtual

Reports the statistics of the current call.

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

Parameters
statsStatistics of the IRtcEngine: RtcStats.

◆ onNetworkQuality()

virtual void agora::rtc::IRtcEngineEventHandler::onNetworkQuality ( uid_t  uid,
int  txQuality,
int  rxQuality 
)
inlinevirtual

Reports the last mile network quality of each user in the channel once every two seconds.

Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, the SDK triggers this callback as many times.

Parameters
uidUser ID. The network quality of the user with this uid is reported. If uid is 0, the local network quality is reported.
txQualityUplink transmission quality rating of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time), and jitter of the uplink network. txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. 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-broadcast profile, but may be inadequate for resolutions higher than 1280 * 720. See QUALITY_TYPE.
rxQualityDownlink network quality rating of the user in terms of the packet loss rate, average RTT, and jitter of the downlink network. See QUALITY_TYPE.

◆ onLocalVideoStats()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStats ( const LocalVideoStats stats)
inlinevirtual

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, the onLocalVideoStats callback reports the statistics of the high-video stream (high bitrate, and high-resolution video stream).
Parameters
statsStatistics of the local video stream. See LocalVideoStats.

◆ onRemoteVideoStats()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoStats ( const RemoteVideoStats stats)
inlinevirtual

Reports the statistics of the video stream from each remote user/host.

The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.

Parameters
statsStatistics of the remote video stream. See RemoteVideoStats.

◆ onLocalAudioStats()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalAudioStats ( const LocalAudioStats stats)
inlinevirtual

Reports the statistics of the local audio stream.

The SDK triggers this callback once every two seconds.

Parameters
statsThe statistics of the local audio stream. See LocalAudioStats.

◆ onRemoteAudioStats()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioStats ( const RemoteAudioStats stats)
inlinevirtual

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

This callback replaces the onAudioQuality callback.

The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times.

Parameters
statsPointer to the statistics of the received remote audio streams. See RemoteAudioStats.

◆ onLocalAudioStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalAudioStateChanged ( LOCAL_AUDIO_STREAM_STATE  state,
LOCAL_AUDIO_STREAM_ERROR  error 
)
inlinevirtual

Occurs when the local audio state changes.

This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur.

Note
When the state is LOCAL_AUDIO_STREAM_STATE_FAILED (3), see the error parameter for details.
Parameters
stateState of the local audio. See LOCAL_AUDIO_STREAM_STATE.
errorThe error information of the local audio. See LOCAL_AUDIO_STREAM_ERROR.

◆ onRemoteAudioStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioStateChanged ( uid_t  uid,
REMOTE_AUDIO_STATE  state,
REMOTE_AUDIO_STATE_REASON  reason,
int  elapsed 
)
inlinevirtual

Occurs when the remote audio state changes.

This callback indicates the state change of the remote audio stream.

Note
This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17.
Parameters
uidID of the remote user whose audio state changes.
stateState of the remote audio. See REMOTE_AUDIO_STATE.
reasonThe reason of the remote audio state change. See REMOTE_AUDIO_STATE_REASON.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onAudioVolumeIndication()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioVolumeIndication ( const AudioVolumeInfo speakers,
unsigned int  speakerNumber,
int  totalVolume 
)
inlinevirtual

Reports which users are speaking, the speakers' volume and whether the local user is speaking.

This callback reports the IDs and volumes of the loudest speakers (at most 3 users) at the moment in the channel, and whether the local user is speaking.

By default, this callback is disabled. You can enable it by calling the enableAudioVolumeIndication method. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.

The SDK triggers two independent onAudioVolumeIndication callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions.

Note
  • To enable the voice activity detection of the local user, ensure that you set report_vad(true) in the enableAudioVolumeIndication method.
  • Calling the muteLocalAudioStream method affects the SDK's behavior:
    • If the local user calls the muteLocalAudioStream method, the SDK stops triggering the local user's callback.
    • 20 seconds after a remote speaker calls the muteLocalAudioStream method, the remote speakers' callback excludes this remote user's information; 20 seconds after all remote users call the muteLocalAudioStream method, the SDK stops triggering the remote speakers' callback.
  • An empty speakers array in the onAudioVolumeIndication callback suggests that no remote user is speaking at the moment.
Parameters
speakersA pointer to AudioVolumeInfo:
  • In the local user's callback, this struct contains the following members:
    • uid = 0,
    • volume = totalVolume, which reports the sum of the voice volume and audio-mixing volume of the local user, and
    • vad, which reports the voice activity status of the local user.
  • In the remote speakers' callback, this array contains the following members:

    • uid of the remote speaker,
    • volume, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and
    • vad = 0.

    An empty speakers array in the callback indicates that no remote user is speaking at the moment.

speakerNumberTotal number of speakers. The value range is [0, 3].
  • In the local user’s callback, speakerNumber = 1, regardless of whether the local user speaks or not.
  • In the remote speakers' callback, the callback reports the IDs and volumes of the three loudest speakers when there are more than three remote users in the channel, and speakerNumber = 3.
totalVolumeTotal volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
  • In the local user’s callback, totalVolume is the sum of the voice volume and audio-mixing volume of the local user.
  • In the remote speakers' callback, totalVolume is the sum of the voice volume and audio-mixing volume of all the remote speakers.

◆ onActiveSpeaker()

virtual void agora::rtc::IRtcEngineEventHandler::onActiveSpeaker ( uid_t  uid)
inlinevirtual

Reports which user is the loudest speaker.

If the user enables the audio volume indication by calling the enableAudioVolumeIndication method, this callback returns the uid of the active speaker detected by the audio volume detection module of the SDK.

Note
  • To receive this callback, you need to call the enableAudioVolumeIndication method.
  • This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment.
Parameters
uidUser ID of the active speaker. A uid of 0 represents the local user.

◆ onVideoStopped()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoStopped ( )
inlinevirtual

DEPRECATED Occurs when the video stops playing.

The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing.

Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_STOPPED(0) in the onLocalVideoStateChanged callback instead.

◆ onFirstLocalVideoFrame()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalVideoFrame ( int  width,
int  height,
int  elapsed 
)
inlinevirtual

Occurs when the first local video frame is displayed/rendered on the local video view.

Parameters
widthWidth (px) of the first local video frame.
heightHeight (px) of the first local video frame.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback. If you call the startPreview method before calling the joinChannel method, then elapsed is the time elapsed from calling the startPreview method until the SDK triggers this callback.

◆ onFirstRemoteVideoDecoded()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteVideoDecoded ( uid_t  uid,
int  width,
int  height,
int  elapsed 
)
inlinevirtual

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

Deprecated:
v2.9.0

This callback is deprecated and replaced by the onRemoteVideoStateChanged callback with the following parameters:

This callback is triggered in either of the following scenarios:

  • 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 the muteLocalVideoStream method to stop sending the video stream.
    • The remote user calls the disableVideo method to disable video.

The application can configure the user view settings in this callback.

Parameters
uidUser ID of the remote user sending the video stream.
widthWidth (px) of the video stream.
heightHeight (px) of the video stream.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onFirstRemoteVideoFrame()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteVideoFrame ( uid_t  uid,
int  width,
int  height,
int  elapsed 
)
inlinevirtual

Occurs when the first remote video frame is rendered.

The SDK triggers this callback when the first frame of the remote video is displayed in the user's video window. The application can retrieve the time elapsed from a user joining the channel until the first video frame is displayed.

Parameters
uidUser ID of the remote user sending the video stream.
widthWidth (px) of the video frame.
heightHeight (px) of the video stream.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onUserMuteAudio()

virtual void agora::rtc::IRtcEngineEventHandler::onUserMuteAudio ( uid_t  uid,
bool  muted 
)
inlinevirtual
Deprecated:
This method is deprecated from v3.0.0, use the onRemoteAudioStateChanged callback instead.

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 does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17.
Parameters
uidUser ID of the remote user.
mutedWhether the remote user's audio stream is muted/unmuted:
  • true: Muted.
  • false: Unmuted.

◆ onUserMuteVideo()

virtual void agora::rtc::IRtcEngineEventHandler::onUserMuteVideo ( uid_t  uid,
bool  muted 
)
inlinevirtual

Occurs when a remote user's video stream playback pauses/resumes.

You can also use the onRemoteVideoStateChanged callback with the following parameters:

The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the muteLocalVideoStream method.

Note
This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17.
Parameters
uidUser ID of the remote user.
mutedWhether the remote user's video stream playback is paused/resumed:
  • true: Paused.
  • false: Resumed.

◆ onUserEnableVideo()

virtual void agora::rtc::IRtcEngineEventHandler::onUserEnableVideo ( uid_t  uid,
bool  enabled 
)
inlinevirtual

Occurs when a specific remote user enables/disables the video module.

Deprecated:
v2.9.0

This callback is deprecated and replaced by the onRemoteVideoStateChanged callback with the following parameters:

Once the video module is disabled, the remote user can only use a voice call. The remote user cannot send or receive any video from other users.

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

Note
This callback returns invalid when the number of users in a channel exceeds 20.
Parameters
uidUser ID of the remote user.
enabledWhether the remote user enables/disables the video module:
  • true: Enable. The remote user can enter a video session.
  • false: Disable. The remote user can only enter a voice session, and cannot send or receive any video stream.

◆ onAudioDeviceStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioDeviceStateChanged ( const char *  deviceId,
int  deviceType,
int  deviceState 
)
inlinevirtual

Occurs when the audio device state changes.

This callback notifies the application that the system's audio device state is changed. For example, a headset is unplugged from the device.

Parameters
deviceIdPointer to the device ID.
deviceTypeDevice type: MEDIA_DEVICE_TYPE.
deviceStateDevice state: MEDIA_DEVICE_STATE_TYPE.

◆ onAudioDeviceVolumeChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioDeviceVolumeChanged ( MEDIA_DEVICE_TYPE  deviceType,
int  volume,
bool  muted 
)
inlinevirtual

Occurs when the volume of the playback device, microphone, or application changes.

Parameters
deviceTypeDevice type: MEDIA_DEVICE_TYPE.
volumeVolume of the device. The value ranges between 0 and 255.
muted
  • true: The audio device is muted.
  • false: The audio device is not muted.

◆ onCameraReady()

virtual void agora::rtc::IRtcEngineEventHandler::onCameraReady ( )
inlinevirtual

DEPRECATED Occurs when the camera turns on and is ready to capture the video.

If the camera fails to turn on, fix the error reported in the onError callback.

Deprecated as of v2.4.1. Use LOCAL_VIDEO_STREAM_STATE_CAPTURING (1) in the onLocalVideoStateChanged callback instead.

◆ onCameraFocusAreaChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onCameraFocusAreaChanged ( int  x,
int  y,
int  width,
int  height 
)
inlinevirtual

Occurs when the camera focus area changes.

The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocusPositionInPreview method.

Note
This callback is for Android and iOS only.
Parameters
xx coordinate of the changed camera focus area.
yy coordinate of the changed camera focus area.
widthWidth of the changed camera focus area.
heightHeight of the changed camera focus area.

◆ onFacePositionChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onFacePositionChanged ( int  imageWidth,
int  imageHeight,
Rectangle vecRectangle,
int *  vecDistance,
int  numFaces 
)
inlinevirtual

Reports the face detection result of the local user. Applies to Android and iOS only.

Since
v3.0.1

Once you enable face detection by calling enableFaceDetection(true), you can get the following information on the local user in real-time:

  • The width and height of the local video.
  • The position of the human face in the local video.
  • The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face.
Note
  • If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device.
  • The SDK stops triggering this callback when a human face is in close proximity to the screen.
  • On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation.
Parameters
imageWidthThe width (px) of the local video.
imageHeightThe height (px) of the local video.
vecRectangleThe position and size of the human face on the local video:
  • x: The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin.
  • y: The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin.
  • width: The width (px) of the human face in the captured video.
  • height: The height (px) of the human face in the captured video.
vecDistanceThe distance (cm) between the human face and the screen.
numFacesThe number of faces detected. If the value is 0, it means that no human face is detected.

◆ onCameraExposureAreaChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onCameraExposureAreaChanged ( int  x,
int  y,
int  width,
int  height 
)
inlinevirtual

Occurs when the camera exposure area changes.

The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method.

Note
This callback is for Android and iOS only.
Parameters
xx coordinate of the changed camera exposure area.
yy coordinate of the changed camera exposure area.
widthWidth of the changed camera exposure area.
heightHeight of the changed camera exposure area.

◆ onAudioMixingFinished()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingFinished ( )
inlinevirtual

Occurs when the audio mixing file playback finishes.

DEPRECATED** use onAudioMixingStateChanged instead.

You can start an audio mixing file playback by calling the startAudioMixing method. The SDK triggers this callback when the audio mixing file playback finishes.

If the startAudioMixing method call fails, an error code returns in the onError callback.

◆ onAudioMixingStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged ( AUDIO_MIXING_STATE_TYPE  state,
AUDIO_MIXING_ERROR_TYPE  errorCode 
)
inlinevirtual

Occurs when the state of the local user's audio mixing file changes.

When you call the startAudioMixing method and the state of audio mixing file changes, the SDK triggers this callback.

  • When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in state, and 0 in errorCode.
  • When exceptions occur during playback, this callback returns 714 in state and an error in errorCode.
  • If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns WARN_AUDIO_MIXING_OPEN_ERROR = 701.
Parameters
stateThe state code. See AUDIO_MIXING_STATE_TYPE.
errorCodeThe error code. See AUDIO_MIXING_ERROR_TYPE.

◆ onRemoteAudioMixingBegin()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioMixingBegin ( )
inlinevirtual

Occurs when a remote user starts audio mixing.

When a remote user calls startAudioMixing to play the background music, the SDK reports this callback.

◆ onRemoteAudioMixingEnd()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioMixingEnd ( )
inlinevirtual

Occurs when a remote user finishes audio mixing.

◆ onAudioEffectFinished()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioEffectFinished ( int  soundId)
inlinevirtual

Occurs when the local audio effect playback finishes.

The SDK triggers this callback when the local audio effect file playback finishes.

Parameters
soundIdID of the local audio effect. Each local audio effect has a unique ID.

◆ onFirstRemoteAudioDecoded()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteAudioDecoded ( uid_t  uid,
int  elapsed 
)
inlinevirtual

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

Deprecated:
v3.0.0

This callback is deprecated. Use onRemoteAudioStateChanged instead.

This callback is triggered in either of the following scenarios:

  • The remote user joins the channel and sends the audio stream.
  • The remote user stops sending the audio stream and re-sends it after 15 seconds. Reasons for such an interruption include:
    • The remote user leaves channel.
    • The remote user drops offline.
    • The remote user calls the muteLocalAudioStream method to stop sending the local audio stream.
    • The remote user calls the disableAudio method to disable audio.
Parameters
uidUser ID of the remote user sending the audio stream.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onVideoDeviceStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoDeviceStateChanged ( const char *  deviceId,
int  deviceType,
int  deviceState 
)
inlinevirtual

Occurs when the video device state changes.

Note
On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged.
Parameters
deviceIdPointer to the device ID of the video device that changes state.
deviceTypeDevice type: MEDIA_DEVICE_TYPE.
deviceStateDevice state: MEDIA_DEVICE_STATE_TYPE.

◆ onLocalVideoStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged ( LOCAL_VIDEO_STREAM_STATE  localVideoState,
LOCAL_VIDEO_STREAM_ERROR  error 
)
inlinevirtual

Occurs when the local video stream state changes.

This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur.

Note
For some device models, the SDK will not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.
Parameters
localVideoStateState type LOCAL_VIDEO_STREAM_STATE. When the state is LOCAL_VIDEO_STREAM_STATE_FAILED (3), see the error parameter for details.
errorThe detailed error information: LOCAL_VIDEO_STREAM_ERROR.

◆ onVideoSizeChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoSizeChanged ( uid_t  uid,
int  width,
int  height,
int  rotation 
)
inlinevirtual

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

Parameters
uidUser ID of the remote user or local user (0) whose video size or rotation changes.
widthNew width (pixels) of the video.
heightNew height (pixels) of the video.
rotationNew rotation of the video [0 to 360).

◆ onRemoteVideoStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoStateChanged ( uid_t  uid,
REMOTE_VIDEO_STATE  state,
REMOTE_VIDEO_STATE_REASON  reason,
int  elapsed 
)
inlinevirtual

Occurs when the remote video state changes.

Note
This callback does not work properly when the number of users (in the Communication profile) or broadcasters (in the Live-broadcast profile) in the channel exceeds 17.
Parameters
uidID of the remote user whose video state changes.
stateState of the remote video. See REMOTE_VIDEO_STATE.
reasonThe reason of the remote video state change. See REMOTE_VIDEO_STATE_REASON.
elapsedTime elapsed (ms) from the local user calling the joinChannel method until the SDK triggers this callback.

◆ onUserEnableLocalVideo()

virtual void agora::rtc::IRtcEngineEventHandler::onUserEnableLocalVideo ( uid_t  uid,
bool  enabled 
)
inlinevirtual

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

Deprecated:
v2.9.0

This callback is deprecated and replaced by the onRemoteVideoStateChanged callback with the following parameters:

This callback is only applicable to the scenario when the user only wants to watch the remote video without sending any video stream to the other user.

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

Parameters
uidUser ID of the remote user.
enabledWhether the specified remote user enables/disables the local video capturing function:
  • true: Enable. Other users in the channel can see the video of this remote user.
  • false: Disable. 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.

◆ onStreamMessage()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamMessage ( uid_t  uid,
int  streamId,
const char *  data,
size_t  length 
)
inlinevirtual

Occurs when the local user receives the data stream from the remote user within five seconds.

The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the sendStreamMessage method.

Parameters
uidUser ID of the remote user sending the message.
streamIdStream ID.
dataPointer to the data received by the local user.
lengthLength of the data in bytes.

◆ onStreamMessageError()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamMessageError ( uid_t  uid,
int  streamId,
int  code,
int  missed,
int  cached 
)
inlinevirtual

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

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.

Parameters
uidUser ID of the remote user sending the message.
streamIdStream ID.
codeError code: ERROR_CODE_TYPE.
missedNumber of lost messages.
cachedNumber of incoming cached messages when the data stream is interrupted.

◆ onMediaEngineLoadSuccess()

virtual void agora::rtc::IRtcEngineEventHandler::onMediaEngineLoadSuccess ( )
inlinevirtual

Occurs when the media engine loads.

◆ onMediaEngineStartCallSuccess()

virtual void agora::rtc::IRtcEngineEventHandler::onMediaEngineStartCallSuccess ( )
inlinevirtual

Occurs when the media engine call starts.

◆ onChannelMediaRelayStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged ( CHANNEL_MEDIA_RELAY_STATE  state,
CHANNEL_MEDIA_RELAY_ERROR  code 
)
inlinevirtual

Occurs when the state of the media stream relay changes.

The SDK returns the state of the current media relay with any error message.

Parameters
stateThe state code in CHANNEL_MEDIA_RELAY_STATE.
codeThe error code in CHANNEL_MEDIA_RELAY_ERROR.

◆ onChannelMediaRelayEvent()

virtual void agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent ( CHANNEL_MEDIA_RELAY_EVENT  code)
inlinevirtual

Reports events during the media stream relay.

Parameters
codeThe event code in CHANNEL_MEDIA_RELAY_EVENT.

◆ onFirstLocalAudioFrame()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalAudioFrame ( int  elapsed)
inlinevirtual

Occurs when the engine sends the first local audio frame.

Parameters
elapsedTime elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.

◆ onFirstRemoteAudioFrame()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstRemoteAudioFrame ( uid_t  uid,
int  elapsed 
)
inlinevirtual

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

Deprecated:
v3.0.0

This callback is deprecated. Use onRemoteAudioStateChanged instead.

Parameters
uidUser ID of the remote user.
elapsedTime elapsed (ms) from the remote user calling joinChannel until the SDK triggers this callback.

◆ onRtmpStreamingStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged ( const char *  url,
RTMP_STREAM_PUBLISH_STATE  state,
RTMP_STREAM_PUBLISH_ERROR  errCode 
)
inlinevirtual

Occurs when the state of the RTMP streaming changes.

The SDK triggers this callback to report the result of the local user calling the addPublishStreamUrl or removePublishStreamUrl method.

This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter.

Parameters
urlThe RTMP URL address.
stateThe RTMP streaming state. See: RTMP_STREAM_PUBLISH_STATE.
errCodeThe detailed error information for streaming. See: RTMP_STREAM_PUBLISH_ERROR.

◆ onStreamPublished()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamPublished ( const char *  url,
int  error 
)
inlinevirtual
Deprecated:
This method is deprecated, use the onRtmpStreamingStateChanged callback instead.

Reports the result of calling the addPublishStreamUrl method. (CDN live only.)

Parameters
urlThe RTMP URL address.
errorError code: ERROR_CODE_TYPE. Main errors include:

◆ onStreamUnpublished()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamUnpublished ( const char *  url)
inlinevirtual
Deprecated:
This method is deprecated, use the onRtmpStreamingStateChanged callback instead.

Reports the result of calling the removePublishStreamUrl method. (CDN live only.)

This callback indicates whether you have successfully removed an RTMP stream from the CDN.

Parameters
urlThe RTMP URL address.

◆ onTranscodingUpdated()

virtual void agora::rtc::IRtcEngineEventHandler::onTranscodingUpdated ( )
inlinevirtual

Occurs when the publisher's transcoding is updated.

When the LiveTranscoding class in the setLiveTranscoding method updates, the SDK triggers the onTranscodingUpdated callback to report the update information to the local host.

Note
If you call the setLiveTranscoding method to set the LiveTranscoding class for the first time, the SDK does not trigger the onTranscodingUpdated callback.

◆ onStreamInjectedStatus()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamInjectedStatus ( const char *  url,
uid_t  uid,
int  status 
)
inlinevirtual

Occurs when a voice or video stream URL address is added to a live broadcast.

Parameters
urlPointer to the URL address of the externally injected stream.
uidUser ID.
statusState of the externally injected stream: INJECT_STREAM_STATUS.

◆ onAudioRouteChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioRouteChanged ( AUDIO_ROUTE_TYPE  routing)
inlinevirtual

Occurs when the local audio route changes.

The SDK triggers this callback when the local audio route switches to an earpiece, speakerphone, headset, or Bluetooth device.

Note
This callback is for Android and iOS only.
Parameters
routingAudio output routing. See: AUDIO_ROUTE_TYPE.

◆ onLocalPublishFallbackToAudioOnly()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalPublishFallbackToAudioOnly ( bool  isFallbackOrRecover)
inlinevirtual

Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to the video after the network conditions improve.

If you call setLocalPublishFallbackOption and set option as STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves.

Note
If the local stream fallbacks to the audio-only stream, the remote user receives the onUserMuteVideo callback.
Parameters
isFallbackOrRecoverWhether the published stream falls back to audio-only or switches back to the video:
  • true: The published stream falls back to audio-only due to poor network conditions.
  • false: The published stream switches back to the video after the network conditions improve.

◆ onRemoteSubscribeFallbackToAudioOnly()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteSubscribeFallbackToAudioOnly ( uid_t  uid,
bool  isFallbackOrRecover 
)
inlinevirtual

Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to the video stream after the network conditions improve.

If you call setRemoteSubscribeFallbackOption and set option as STREAM_FALLBACK_OPTION_AUDIO_ONLY, the SDK triggers this callback when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves.

Note
Once the remote media stream switches to the low stream due to poor network conditions, you can monitor the stream switch between a high and low stream in the RemoteVideoStats callback.
Parameters
uidID of the remote user sending the stream.
isFallbackOrRecoverWhether the remotely subscribed media stream falls back to audio-only or switches back to the video:
  • true: The remotely subscribed media stream falls back to audio-only due to poor network conditions.
  • false: The remotely subscribed media stream switches back to the video stream after the network conditions improved.

◆ onRemoteAudioTransportStats()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteAudioTransportStats ( uid_t  uid,
unsigned short  delay,
unsigned short  lost,
unsigned short  rxKBitRate 
)
inlinevirtual

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

Deprecated:
This callback is deprecated and replaced by the onRemoteAudioStats callback.

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.

Parameters
uidUser ID of the remote user sending the audio packet.
delayNetwork time delay (ms) from the remote user sending the audio packet to the local user.
lostPacket loss rate (%) of the audio packet sent from the remote user.
rxKBitRateReceived bitrate (Kbps) of the audio packet sent from the remote user.

◆ onRemoteVideoTransportStats()

virtual void agora::rtc::IRtcEngineEventHandler::onRemoteVideoTransportStats ( uid_t  uid,
unsigned short  delay,
unsigned short  lost,
unsigned short  rxKBitRate 
)
inlinevirtual

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

Deprecated:
This callback is deprecated and replaced by the onRemoteVideoStats callback.

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.

Parameters
uidUser ID of the remote user sending the video packet.
delayNetwork time delay (ms) from the remote user sending the video packet to the local user.
lostPacket loss rate (%) of the video packet sent from the remote user.
rxKBitRateReceived bitrate (Kbps) of the video packet sent from the remote user.

◆ onMicrophoneEnabled()

virtual void agora::rtc::IRtcEngineEventHandler::onMicrophoneEnabled ( bool  enabled)
inlinevirtual

Occurs when the microphone is enabled/disabled.

Deprecated:
v2.9.0

The onMicrophoneEnabled callback is deprecated. Use LOCAL_AUDIO_STREAM_STATE_STOPPED (0) or LOCAL_AUDIO_STREAM_STATE_RECORDING (1) in the onLocalAudioStateChanged callback instead.

The SDK triggers this callback when the local user resumes or stops capturing the local audio stream by calling the enbaleLocalAudio method.

Parameters
enabledWhether the microphone is enabled/disabled:
  • true: Enabled.
  • false: Disabled.

◆ onConnectionStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onConnectionStateChanged ( CONNECTION_STATE_TYPE  state,
CONNECTION_CHANGED_REASON_TYPE  reason 
)
inlinevirtual

Occurs when the connection state between the SDK and the server changes.

Parameters
stateSee CONNECTION_STATE_TYPE.
reasonSee CONNECTION_CHANGED_REASON_TYPE.

◆ onNetworkTypeChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onNetworkTypeChanged ( NETWORK_TYPE  type)
inlinevirtual

Occurs when the local network type changes.

When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions.

Parameters
typeSee NETWORK_TYPE.

◆ onLocalUserRegistered()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalUserRegistered ( uid_t  uid,
const char *  userAccount 
)
inlinevirtual

Occurs when the local user successfully registers a user account by calling the registerLocalUserAccount method or joins a channel by calling the joinChannelWithUserAccount method.This callback reports the user ID and user account of the local user.

Parameters
uidThe ID of the local user.
userAccountThe user account of the local user.

◆ onUserInfoUpdated()

virtual void agora::rtc::IRtcEngineEventHandler::onUserInfoUpdated ( uid_t  uid,
const UserInfo info 
)
inlinevirtual

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 (userInfo), and triggers this callback on the local client.

Parameters
uidThe ID of the remote user.
infoThe UserInfo object that contains the user ID and user account of the remote user.