Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | List of all members
agora::rtc::IRtcEngineEventHandler Class Reference

`#include <IAgoraRtcEngine.h>`

Inherited by agora::rtc::IRtcEngineEventHandlerEx.

## Public Member Functions
virtual | ~IRtcEngineEventHandler ()
virtual const char * | eventHandlerType () const
virtual void | onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
virtual void | onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
virtual void | onProxyConnected (const char *channel, uid_t uid, PROXY_TYPE proxyType, const char *localProxyIp, int elapsed)
virtual void | onError (int err, const char *msg)
virtual void | onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost) __deprecated
virtual void | onLastmileProbeResult (const LastmileProbeResult &result)
virtual void | onAudioVolumeIndication (const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
virtual void | onLeaveChannel (const RtcStats &stats)
virtual void | onRtcStats (const RtcStats &stats)
virtual void | onAudioDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
virtual void | onAudioMixingPositionChanged (int64_t position)
virtual void | onAudioMixingFinished () __deprecated
virtual void | onAudioEffectFinished (int soundId)
virtual void | onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
virtual void | onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
virtual void | onIntraRequestReceived ()
virtual void | onUplinkNetworkInfoUpdated (const UplinkNetworkInfo &info)
virtual void | onLastmileQuality (int quality)
virtual void | onFirstLocalVideoFrame (VIDEO_SOURCE_TYPE source, int width, int height, int elapsed)
virtual void | onFirstLocalVideoFramePublished (VIDEO_SOURCE_TYPE source, int elapsed)
virtual void | onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed) __deprecated
virtual void | onVideoSizeChanged (VIDEO_SOURCE_TYPE sourceType, uid_t uid, int width, int height, int rotation)
virtual void | onLocalVideoEvent (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_EVENT_TYPE event)
virtual void | onLocalVideoStateChanged (VIDEO_SOURCE_TYPE source, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_REASON reason)
virtual void | onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
virtual void | onFirstRemoteVideoFrame (uid_t uid, int width, int height, int elapsed)
virtual void | onUserJoined (uid_t uid, int elapsed)
virtual void | onUserOffline (uid_t uid, USER_OFFLINE_REASON_TYPE reason)
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 | onUserStateChanged (uid_t uid, REMOTE_USER_STATE state)
virtual void | onUserEnableLocalVideo (uid_t uid, bool enabled) __deprecated
virtual void | onRemoteAudioStats (const RemoteAudioStats &stats)
virtual void | onLocalAudioStats (const LocalAudioStats &stats)
virtual void | onLocalVideoStats (VIDEO_SOURCE_TYPE source, const LocalVideoStats &stats)
virtual void | onRemoteVideoStats (const RemoteVideoStats &stats)
virtual void | onCameraReady () __deprecated
virtual void | onCameraFocusAreaChanged (int x, int y, int width, int height)
virtual void | onCameraExposureAreaChanged (int x, int y, int width, int height)
virtual void | onFacePositionChanged (int imageWidth, int imageHeight, const Rectangle *vecRectangle, const int *vecDistance, int numFaces)
virtual void | onVideoStopped () __deprecated
virtual void | onAudioMixingStateChanged (AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_REASON_TYPE reason)
virtual void | onRhythmPlayerStateChanged (RHYTHM_PLAYER_STATE_TYPE state, RHYTHM_PLAYER_REASON reason)
virtual void | onConnectionLost ()
virtual void | onConnectionInterrupted () __deprecated
virtual void | onConnectionBanned () __deprecated
virtual void | onStreamMessage (uid_t uid, int streamId, const char *data, size_t length, uint64_t sentTs)
virtual void | onStreamMessageError (uid_t uid, int streamId, int code, int missed, int cached)
virtual void | onRdtMessage (uid_t userId, RdtStreamType type, const char *data, size_t length)
virtual void | onRdtStateChanged (uid_t userId, RdtState state)
virtual void | onMediaControlMessage (uid_t userId, const char *data, size_t length)
virtual void | onRequestToken ()
virtual void | onTokenPrivilegeWillExpire (const char *token)
virtual void | onLicenseValidationFailure (LICENSE_ERROR_TYPE error)
virtual void | onFirstLocalAudioFramePublished (int elapsed)
virtual void | onFirstRemoteAudioDecoded (uid_t uid, int elapsed) __deprecated
virtual void | onFirstRemoteAudioFrame (uid_t uid, int elapsed) __deprecated
virtual void | onLocalAudioStateChanged (LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_REASON reason)
virtual void | onRemoteAudioStateChanged (uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
virtual void | onActiveSpeaker (uid_t uid)
virtual void | onContentInspectResult (media::CONTENT_INSPECT_RESULT result)
virtual void | onSnapshotTaken (uid_t uid, const char *filePath, int width, int height, int errCode)
virtual void | onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole, const ClientRoleOptions &newRoleOptions)
virtual void | onClientRoleChangeFailed (CLIENT_ROLE_CHANGE_FAILED_REASON reason, CLIENT_ROLE_TYPE currentRole)
virtual void | onAudioDeviceVolumeChanged (MEDIA_DEVICE_TYPE deviceType, int volume, bool muted)
virtual void | onRtmpStreamingStateChanged (const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_REASON reason)
virtual void | onRtmpStreamingEvent (const char *url, RTMP_STREAMING_EVENT eventCode)
virtual void | onTranscodingUpdated ()
virtual void | onAudioRoutingChanged (int routing)
virtual void | onChannelMediaRelayStateChanged (int state, int code)
virtual void | onRemoteSubscribeFallbackToAudioOnly (uid_t uid, bool isFallbackOrRecover)
virtual void | onRemoteAudioTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
virtual void | onRemoteVideoTransportStats (uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate) __deprecated
virtual void | onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
virtual void | onNetworkTypeChanged (NETWORK_TYPE type)
virtual void | onEncryptionError (ENCRYPTION_ERROR_TYPE errorType)
virtual void | onPermissionError (PERMISSION_TYPE permissionType)
virtual void | onPermissionGranted (agora::rtc::PERMISSION_TYPE permissionType)
virtual void | onLocalUserRegistered (uid_t uid, const char *userAccount)
virtual void | onUserInfoUpdated (uid_t uid, const UserInfo &info)
virtual void | onUserAccountUpdated (uid_t uid, const char *userAccount)
virtual void | onVideoRenderingTracingResult (uid_t uid, MEDIA_TRACE_EVENT currentEvent, VideoRenderingTracingInfo tracingInfo)
virtual void | onLocalVideoTranscoderError (const TranscodingVideoStream &stream, VIDEO_TRANSCODER_ERROR error)
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)
virtual void | onVideoSubscribeStateChanged (const char *channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
virtual void | onAudioPublishStateChanged (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
virtual void | onVideoPublishStateChanged (VIDEO_SOURCE_TYPE source, const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
virtual void | onTranscodedStreamLayoutInfo (uid_t uid, int width, int height, int layoutCount, const VideoLayout *layoutlist)
virtual void | onAudioMetadataReceived (uid_t uid, const char *metadata, size_t length)
virtual void | onExtensionEventWithContext (const ExtensionContext &context, const char *key, const char *value)
virtual void | onExtensionStartedWithContext (const ExtensionContext &context)
virtual void | onExtensionStoppedWithContext (const ExtensionContext &context)
virtual void | onExtensionErrorWithContext (const ExtensionContext &context, int error, const char *message)
virtual void | onSetRtmFlagResult (int code)
virtual void | onMultipathStats (const MultipathStats &stats)
virtual void | onRenewTokenResult (const char *token, RENEW_TOKEN_ERROR_CODE code)

## Detailed Description

The IRtcEngineEventHandler class.

The SDK uses this class to send callback event notifications to the app, and the app inherits the methods in this class to retrieve these event notifications.

All methods in this class have their default (empty) implementations, and the app can inherit only some of the required events instead of all. In the callback methods, the app should avoid time-consuming tasks or calling blocking APIs, otherwise the SDK may not work properly.

## Constructor & Destructor Documentation

## ◆ ~IRtcEngineEventHandler()

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

## Member Function Documentation

## ◆ eventHandlerType()

virtual const char * agora::rtc::IRtcEngineEventHandler::eventHandlerType | ( |  | ) | const
| inlinevirtual

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx, and agora::rtc::IRtcEngineEventHandlerInternal.

## ◆ 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. 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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRejoinChannelSuccess()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onProxyConnected()

virtual void agora::rtc::IRtcEngineEventHandler::onProxyConnected | ( | const char * | channel,
|  | uid_t | uid,
|  | PROXY_TYPE | proxyType,
|  | const char * | localProxyIp,
|  | int | elapsed )
| inlinevirtual

Reports the proxy connection state.

You can use this callback to listen for the state of the SDK connecting to a proxy. For example, when a user calls `setCloudProxy` and joins a channel successfully, the SDK triggers this callback to report the user ID, the proxy type connected, and the time elapsed fromthe user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until this callback is triggered.

Parameters

  channel | The channel name.
  uid | The user ID.
  proxyType | The proxy type connected. See `PROXY_TYPE`.
  localProxyIp | Reserved for future use.
  elapsed | The time elapsed (ms) from the user calling `joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options)` until this callback is triggered.

## ◆ onError()

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

Reports an error during SDK runtime.

This callback indicates that an error (concerning network or media) occurs during SDK runtime. In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user about the issue.

Parameters

  err | Error code. See `ERROR_CODE_TYPE`.
  msg | The error message.

## ◆ onAudioQuality()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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 `startLastmileProbeTest`.

Parameters

  result | The uplink and downlink last-mile network probe test result. See `LastmileProbeResult`.

## ◆ onAudioVolumeIndication()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLeaveChannel()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRtcStats()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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.

Note
  This method is for Windows and macOS only.

Parameters

  deviceId | The device ID.
  deviceType | The device type. See `MEDIA_DEVICE_TYPE`.
  deviceState | The device state. See `MEDIA_DEVICE_STATE_TYPE`.

## ◆ onAudioMixingPositionChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingPositionChanged | ( | int64_t | position | ) |
| inlinevirtual

Reports the playback progress of a music file.

After you called the `startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos)` method to play a music file, the SDK triggers this callback every two seconds to report the playback progress.

Parameters

  position | The playback progress (ms).

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ onAudioMixingFinished()

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

Occurs when the playback of the local music file finishes.

Deprecated
  This method is deprecated, use onAudioMixingStateChanged instead.

After you call `startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos)` to play a local music file, this callback occurs when the playback finishes. If the call of `startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos)` fails, the error code `WARN_AUDIO_MIXING_OPEN_ERROR` is returned.

## ◆ onAudioEffectFinished()

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

Occurs when the playback of the local music file finishes.

This callback occurs when the local audio effect file finishes playing.

Parameters

  soundId | The ID of the audio effect. The unique ID of each audio effect file.

## ◆ onVideoDeviceStateChanged()

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

Occurs when the video device state changes.

This callback reports the change of system video devices, such as being unplugged or removed. On a Windows device with an external camera for video capturing, the video disables once the external camera is unplugged.

Note
  This callback is for Windows and macOS only.

Parameters

  deviceId | The device ID.
  deviceType | Media device types. See `MEDIA_DEVICE_TYPE`.
  deviceState | Media device states. See `MEDIA_DEVICE_STATE_TYPE`.

## ◆ 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.

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onIntraRequestReceived()

virtual void agora::rtc::IRtcEngineEventHandler::onIntraRequestReceived | ( |  | ) |
| inlinevirtual

Occurs when intra request from remote user is received.

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUplinkNetworkInfoUpdated()

virtual void agora::rtc::IRtcEngineEventHandler::onUplinkNetworkInfoUpdated | ( | const UplinkNetworkInfo & | info | ) |
| inlinevirtual

Occurs when the uplink network information changes.

The SDK triggers this callback when the uplink network information changes.

Note
  This callback only applies to scenarios where you push externally encoded video data in H.264 format to the SDK.

Parameters

  info | The uplink network information. See `UplinkNetworkInfo`.

## ◆ onLastmileQuality()

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

Reports the last-mile network quality of the local user.

This callback reports the last-mile network conditions of the local user before the user joins the channel. Last mile refers to the connection between the local device and Agora's edge server. Before the user joins the channel, this callback is triggered by the SDK once `startLastmileProbeTest` is called and reports the last-mile network conditions of the local user.

Parameters

  quality | The last-mile network quality. See `QUALITY_TYPE`.

## ◆ onFirstLocalVideoFrame()

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

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

The SDK triggers this callback when the first local video frame is displayed on the local video view.

Parameters

  source | The type of the video source. See `VIDEO_SOURCE_TYPE`.
  width | The width (px) of the first local video frame.
  height | The height (px) of the first local video frame.
  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)` to join the channel to when the SDK triggers this callback. If `startPreview()` / `startPreview(VIDEO_SOURCE_TYPE sourceType)` is called before joining the channel, this parameter indicates the time elapsed from calling `startPreview()` or `startPreview(VIDEO_SOURCE_TYPE sourceType)` to when this event occurred.

## ◆ onFirstLocalVideoFramePublished()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalVideoFramePublished | ( | VIDEO_SOURCE_TYPE | source,
|  | int | elapsed )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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.

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onVideoSizeChanged()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLocalVideoEvent()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoEvent | ( | VIDEO_SOURCE_TYPE | source,
|  | LOCAL_VIDEO_EVENT_TYPE | event )
| inlinevirtual

Occurs when the local video event occurs.

Since
  v4.6.1

This callback is triggered when a video event occurs. You can use this callback to get the reason for such an event.

Parameters

  source | The video source type: VIDEO_SOURCE_TYPE.
  event | The local video event type: LOCAL_VIDEO_EVENT_TYPE.

## ◆ onLocalVideoStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStateChanged | ( | VIDEO_SOURCE_TYPE | source,
|  | LOCAL_VIDEO_STREAM_STATE | state,
|  | LOCAL_VIDEO_STREAM_REASON | reason )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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 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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onFirstRemoteVideoFrame()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserJoined()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserOffline()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserMuteAudio()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserMuteVideo()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserEnableVideo()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onUserStateChanged | ( | uid_t | uid,
|  | REMOTE_USER_STATE | state )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserEnableLocalVideo()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRemoteAudioStats()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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

  stats | Local audio statistics. See `LocalAudioStats`.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLocalVideoStats()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoStats | ( | VIDEO_SOURCE_TYPE | source,
|  | const LocalVideoStats & | stats )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRemoteVideoStats()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onCameraReady()

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

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

Deprecated
  Use `LOCAL_VIDEO_STREAM_STATE_CAPTURING(1)` in onLocalVideoStateChanged instead.

This callback indicates that the camera has been successfully turned on and you can start to capture video.

## ◆ onCameraFocusAreaChanged()

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

Occurs when the camera focus area changes.

Note
  This callback is for Android and iOS only.

Parameters

  x | The x-coordinate of the changed camera focus area.
  y | The y-coordinate of the changed camera focus area.
  width | The width of the changed camera focus area.
  height | The height of the changed camera focus area.

## ◆ 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 `setCameraExposurePosition`.

Note
  This callback is for Android and iOS only.

Parameters

  x | The x coordinate of the changed camera exposure area.
  y | The y coordinate of the changed camera exposure area.
  width | The width of the changed camera exposure area.
  height | The height of the changed exposure area.

## ◆ onFacePositionChanged()

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

Reports the face detection result of the local user.

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 view.
- The distance between the human face and the screen. This value is based on the fitting calculation of the local video size and the position of the human face.

Note
  - This callback is for Android and iOS only.
  - When it is detected that the face in front of the camera disappears, the callback will be triggered immediately. When no human face is detected, the frequency of this callback to be triggered wil be decreased 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 value of distance reported in this callback may be slightly different from the actual `distance`. Therefore, Agora does not recommend using it for accurate calculation.

Parameters

  imageWidth | The width (px) of the video image captured by the local camera.
  imageHeight | The height (px) of the video image captured by the local camera.
  vecRectangle | An array of `numFaces`, representing the detected face information: `x`: The x-coordinate (px) of the human face in the local view. Taking the top left corner of the view as the origin, the x-coordinate represents the horizontal position of the human face relative to the origin. `y`: The y-coordinate (px) of the human face in the local view. Taking the top left corner of the view as the origin, the y-coordinate represents the vertical position of the human face relative to the origin. `width`: The width (px) of the human face in the captured view. `height`: The height (px) of the human face in the captured view.
  vecDistance | An array of `numFaces`, representing the distance (cm) between a face and the device screen.
  numFaces | The number of faces detected. If the value is 0, it means that no human face is detected.

## ◆ onVideoStopped()

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

Occurs when the video stops playing.

Deprecated
  Use `LOCAL_VIDEO_STREAM_STATE_STOPPED(0)` in the onLocalVideoStateChanged callback instead.

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.

## ◆ onAudioMixingStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged | ( | AUDIO_MIXING_STATE_TYPE | state,
|  | AUDIO_MIXING_REASON_TYPE | reason )
| inlinevirtual

Occurs when the playback state of the music file changes.

This callback occurs when the playback state of the music file changes, and reports the current state and error code.

Parameters

  state | The playback state of the music file. See `AUDIO_MIXING_STATE_TYPE`.
  reason | Error code. See `AUDIO_MIXING_REASON_TYPE`.

## ◆ onRhythmPlayerStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRhythmPlayerStateChanged | ( | RHYTHM_PLAYER_STATE_TYPE | state,
|  | RHYTHM_PLAYER_REASON | reason )
| inlinevirtual

Occurs when the state of virtual metronome changes.

When the state of the virtual metronome changes, the SDK triggers this callback to report the current state of the virtual metronome. This callback indicates the state of the local audio stream and enables you to troubleshoot issues when audio exceptions occur.

Note
  This callback is for Android and iOS only.

Parameters

  state | For the current virtual metronome status, see `RHYTHM_PLAYER_STATE_TYPE`.
  reason | For the error codes and error messages related to virtual metronome errors, see `RHYTHM_PLAYER_REASON`.

## ◆ 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(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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onConnectionInterrupted()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onConnectionBanned()

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

Occurs when the connection is banned by the Agora server.

Deprecated
  Use `onConnectionStateChanged` instead.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onStreamMessage()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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.

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRdtMessage()

virtual void agora::rtc::IRtcEngineEventHandler::onRdtMessage | ( | uid_t | userId,
|  | RdtStreamType | type,
|  | const char * | data,
|  | size_t | length )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRdtStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRdtStateChanged | ( | uid_t | userId,
|  | RdtState | state )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onMediaControlMessage()

virtual void agora::rtc::IRtcEngineEventHandler::onMediaControlMessage | ( | uid_t | userId,
|  | const char * | data,
|  | size_t | length )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRequestToken()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onTokenPrivilegeWillExpire()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLicenseValidationFailure()

virtual void agora::rtc::IRtcEngineEventHandler::onLicenseValidationFailure | ( | LICENSE_ERROR_TYPE | error | ) |
| inlinevirtual

Occurs when connection license verification fails.

You can know the reason accordding to error code

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onFirstLocalAudioFramePublished()

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalAudioFramePublished | ( | int | elapsed | ) |
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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
  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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onFirstRemoteAudioFrame()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLocalAudioStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalAudioStateChanged | ( | LOCAL_AUDIO_STREAM_STATE | state,
|  | LOCAL_AUDIO_STREAM_REASON | reason )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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.

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onActiveSpeaker()

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

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onContentInspectResult()

virtual void agora::rtc::IRtcEngineEventHandler::onContentInspectResult | ( | media::CONTENT_INSPECT_RESULT | result | ) |
| inlinevirtual

Reports result of content inspection.

Parameters

  result | The result of content inspection: CONTENT_INSPECT_RESULT.

## ◆ onSnapshotTaken()

virtual void agora::rtc::IRtcEngineEventHandler::onSnapshotTaken | ( | uid_t | uid,
|  | const char * | filePath,
|  | int | width,
|  | int | height,
|  | int | errCode )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onClientRoleChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onClientRoleChanged | ( | CLIENT_ROLE_TYPE | oldRole,
|  | CLIENT_ROLE_TYPE | newRole,
|  | const ClientRoleOptions & | newRoleOptions )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onClientRoleChangeFailed()

virtual void agora::rtc::IRtcEngineEventHandler::onClientRoleChangeFailed | ( | CLIENT_ROLE_CHANGE_FAILED_REASON | reason,
|  | CLIENT_ROLE_TYPE | currentRole )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onAudioDeviceVolumeChanged()

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

Reports the volume change of the audio device or app.

Occurs when the volume on the playback device, audio capture device, or the volume of the app changes.

Note
  This callback is for Windows and macOS only.

Parameters

  deviceType | The device type. See `MEDIA_DEVICE_TYPE`.
  volume | The volume value. The range is [0, 255].
  muted | Whether the audio device is muted: `true`: The audio device is muted. `false`: The audio device is not muted.

## ◆ onRtmpStreamingStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged | ( | const char * | url,
|  | RTMP_STREAM_PUBLISH_STATE | state,
|  | RTMP_STREAM_PUBLISH_REASON | reason )
| inlinevirtual

Occurs when the state of Media Push changes.

When the state of Media Push changes, the SDK triggers this callback and reports the URL address and the current state of the Media Push. This callback indicates the state of the Media Push. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the error code parameter.

Parameters

  url | The URL address where the state of the Media Push changes.
  state | The current state of the Media Push. See `RTMP_STREAM_PUBLISH_STATE`.
  reason | Reasons for the changes in the Media Push status. See `RTMP_STREAM_PUBLISH_REASON`.

## ◆ onRtmpStreamingEvent()

virtual void agora::rtc::IRtcEngineEventHandler::onRtmpStreamingEvent | ( | const char * | url,
|  | RTMP_STREAMING_EVENT | eventCode )
| inlinevirtual

Reports events during the Media Push.

Parameters

  url | The URL for Media Push.
  eventCode | The event code of Media Push. See `RTMP_STREAMING_EVENT`.

## ◆ onTranscodingUpdated()

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

Occurs when the publisher's transcoding is updated.

When the `LiveTranscoding` class in the `startRtmpStreamWithTranscoding` method updates, the SDK triggers the `onTranscodingUpdated` callback to report the update information.

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

## ◆ onAudioRoutingChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioRoutingChanged | ( | int | routing | ) |
| inlinevirtual

Occurs when the local audio route changes.

Note
  This method is for Android, iOS and macOS only.

Parameters

  routing | The current audio routing. See `AudioRoute`.

## ◆ onChannelMediaRelayStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged | ( | int | state,
|  | int | 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

  state | The state code. See `CHANNEL_MEDIA_RELAY_STATE`.
  code | The error code of the channel media relay. See `CHANNEL_MEDIA_RELAY_ERROR`.

## ◆ onRemoteSubscribeFallbackToAudioOnly()

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

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.

If you call `setRemoteSubscribeFallbackOption` and set `option` to `STREAM_FALLBACK_OPTION_AUDIO_ONLY`, the SDK triggers this callback in the following situations:

- The downstream network condition is poor, and the subscribed video stream is downgraded to audio-only stream.
- The downstream network condition has improved, and the subscribed stream has been restored to video stream.

Note
  Once the remote media stream switches to the low-quality video stream due to weak network conditions, you can monitor the stream switch between a high-quality and low-quality stream in the `onRemoteVideoStats` callback.

Parameters

  uid | The user ID of the remote user.
  isFallbackOrRecover | - `true`: The subscribed media stream falls back to audio-only due to poor network conditions. `false`: The subscribed media stream switches back to the video stream after the network conditions improve.

## ◆ 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
  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).

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ 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
  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).

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onConnectionStateChanged()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onNetworkTypeChanged()

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

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onEncryptionError()

virtual void agora::rtc::IRtcEngineEventHandler::onEncryptionError | ( | ENCRYPTION_ERROR_TYPE | errorType | ) |
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onPermissionError()

virtual void agora::rtc::IRtcEngineEventHandler::onPermissionError | ( | PERMISSION_TYPE | permissionType | ) |
| inlinevirtual

Occurs when the SDK cannot get the device permission.

When the SDK fails to get the device permission, the SDK triggers this callback to report which device permission cannot be got.

Parameters

  permissionType | The type of the device permission. See `PERMISSION_TYPE`.

## ◆ onPermissionGranted()

virtual void agora::rtc::IRtcEngineEventHandler::onPermissionGranted | ( | agora::rtc::PERMISSION_TYPE | permissionType | ) |
| inlinevirtual

Reports the permission granted.

Parameters

  permission | `PERMISSION`

## ◆ onLocalUserRegistered()

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

Occurs when the local user registers a user account.

After the local user successfully calls `registerLocalUserAccount` to register the user account or calls `joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options)` to join a channel, the SDK triggers the callback and informs the local user's UID and User Account.

Parameters

  uid | The ID of the local user.
  userAccount | The 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, 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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onUserAccountUpdated()

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

Occurs when the user account is updated.

Parameters

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onVideoRenderingTracingResult()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoRenderingTracingResult | ( | uid_t | uid,
|  | MEDIA_TRACE_EVENT | currentEvent,
|  | VideoRenderingTracingInfo | tracingInfo )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onLocalVideoTranscoderError()

virtual void agora::rtc::IRtcEngineEventHandler::onLocalVideoTranscoderError | ( | const TranscodingVideoStream & | stream,
|  | VIDEO_TRANSCODER_ERROR | error )
| inlinevirtual

Occurs when there's an error during the local video mixing.

When you fail to call `startLocalVideoTranscoder` or `updateLocalTranscoderConfiguration`, the SDK triggers this callback to report the reason.

Parameters

  stream | The video streams that cannot be mixed during video mixing. See `TranscodingVideoStream`.
  error | The reason for local video mixing error. See `VIDEO_TRANSCODER_ERROR`.

## ◆ onUploadLogResult()

virtual void agora::rtc::IRtcEngineEventHandler::onUploadLogResult | ( | const char * | requestId,
|  | bool | success,
|  | UPLOAD_ERROR_REASON | reason )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onAudioSubscribeStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioSubscribeStateChanged | ( | const char * | channel,
|  | uid_t | uid,
|  | STREAM_SUBSCRIBE_STATE | oldState,
|  | STREAM_SUBSCRIBE_STATE | newState,
|  | int | elapseSinceLastState )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onVideoSubscribeStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoSubscribeStateChanged | ( | const char * | channel,
|  | uid_t | uid,
|  | STREAM_SUBSCRIBE_STATE | oldState,
|  | STREAM_SUBSCRIBE_STATE | newState,
|  | int | elapseSinceLastState )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onAudioPublishStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioPublishStateChanged | ( | const char * | channel,
|  | STREAM_PUBLISH_STATE | oldState,
|  | STREAM_PUBLISH_STATE | newState,
|  | int | elapseSinceLastState )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onVideoPublishStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onVideoPublishStateChanged | ( | VIDEO_SOURCE_TYPE | source,
|  | const char * | channel,
|  | STREAM_PUBLISH_STATE | oldState,
|  | STREAM_PUBLISH_STATE | newState,
|  | int | elapseSinceLastState )
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onTranscodedStreamLayoutInfo()

virtual void agora::rtc::IRtcEngineEventHandler::onTranscodedStreamLayoutInfo | ( | uid_t | uid,
|  | int | width,
|  | int | height,
|  | int | layoutCount,
|  | const VideoLayout * | layoutlist )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onAudioMetadataReceived()

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMetadataReceived | ( | uid_t | uid,
|  | const char * | metadata,
|  | size_t | length )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onExtensionEventWithContext()

virtual void agora::rtc::IRtcEngineEventHandler::onExtensionEventWithContext | ( | const ExtensionContext & | context,
|  | const char * | key,
|  | const char * | value )
| inlinevirtual

The event callback of the extension.

To listen for events while the extension is running, you need to register this callback.

Parameters

  context | The context information of the extension, see `ExtensionContext`.
  key | The key of the extension.
  value | The value of the extension key.

## ◆ onExtensionStartedWithContext()

virtual void agora::rtc::IRtcEngineEventHandler::onExtensionStartedWithContext | ( | const ExtensionContext & | context | ) |
| inlinevirtual

Occurrs when the extension is enabled.

The callback is triggered after the extension is successfully enabled.

Parameters

  context | The context information of the extension, see `ExtensionContext`.

## ◆ onExtensionStoppedWithContext()

virtual void agora::rtc::IRtcEngineEventHandler::onExtensionStoppedWithContext | ( | const ExtensionContext & | context | ) |
| inlinevirtual

Occurs when the extension is disabled.

The callback is triggered after the extension is successfully disabled.

Parameters

  context | The context information of the extension, see `ExtensionContext`.

## ◆ onExtensionErrorWithContext()

virtual void agora::rtc::IRtcEngineEventHandler::onExtensionErrorWithContext | ( | const ExtensionContext & | context,
|  | int | error,
|  | const char * | message )
| inlinevirtual

Occurs when the extension runs incorrectly.

In case of extension enabling failure or runtime errors, the extension triggers this callback and reports the error code along with the reasons.

Parameters

  context | The context information of the extension, see `ExtensionContext`.
  error | Error code. For details, see the extension documentation provided by the extension provider.
  message | Reason. For details, see the extension documentation provided by the extension provider.

## ◆ onSetRtmFlagResult()

virtual void agora::rtc::IRtcEngineEventHandler::onSetRtmFlagResult | ( | int | code | ) |
| inlinevirtual

Occurs when the SDK receives RTM setting change response.

@technical preview

Parameters

  code | The error code.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onMultipathStats()

virtual void agora::rtc::IRtcEngineEventHandler::onMultipathStats | ( | const MultipathStats & | stats | ) |
| inlinevirtual

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.

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.

## ◆ onRenewTokenResult()

virtual void agora::rtc::IRtcEngineEventHandler::onRenewTokenResult | ( | const char * | token,
|  | RENEW_TOKEN_ERROR_CODE | code )
| inlinevirtual

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

Reimplemented in agora::rtc::IRtcEngineEventHandlerEx.