Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtc::IRtcEngineEventHandlerEx Class Reference
Inheritance diagram for agora::rtc::IRtcEngineEventHandlerEx:
agora::rtc::IRtcEngineEventHandler agora::rtc::IRtcEngineEventHandlerInternal

Public Member Functions

virtual void onJoinChannelSuccess (conn_id_t connId, const char *channel, uid_t uid, int elapsed)
 
virtual void onRejoinChannelSuccess (conn_id_t connId, const char *channel, uid_t uid, int elapsed)
 
virtual void onWarning (conn_id_t connId, int warn, const char *msg)
 
virtual void onError (conn_id_t connId, int err, const char *msg)
 
virtual void onAudioQuality (conn_id_t connId, uid_t uid, int quality, unsigned short delay, unsigned short lost)
 
virtual void onLastmileProbeResult (conn_id_t connId, const LastmileProbeResult &result)
 
virtual void onAudioVolumeIndication (conn_id_t connId, const AudioVolumeInfo *speakers, unsigned int speakerNumber, int totalVolume)
 
virtual void onLeaveChannel (conn_id_t connId, const RtcStats &stats)
 
virtual void onRtcStats (conn_id_t connId, const RtcStats &stats)
 
virtual void onAudioDeviceStateChanged (conn_id_t connId, const char *deviceId, int deviceType, int deviceState)
 
virtual void onAudioMixingFinished (conn_id_t connId)
 
virtual void onRemoteAudioMixingBegin (conn_id_t connId)
 
virtual void onRemoteAudioMixingEnd (conn_id_t connId)
 
virtual void onAudioEffectFinished (conn_id_t connId, int soundId)
 
virtual void onVideoDeviceStateChanged (conn_id_t connId, const char *deviceId, int deviceType, int deviceState)
 
virtual void onMediaDeviceChanged (conn_id_t connId, int deviceType)
 
virtual void onNetworkQuality (conn_id_t connId, uid_t uid, int txQuality, int rxQuality)
 
virtual void onIntraRequestReceived (conn_id_t connId)
 
virtual void onLastmileQuality (conn_id_t connId, int quality)
 
virtual void onFirstLocalVideoFrame (conn_id_t connId, int width, int height, int elapsed)
 
virtual void onFirstLocalVideoFramePublished (conn_id_t connId, int elapsed)
 
virtual void onVideoSourceFrameSizeChanged (conn_id_t connId, VIDEO_SOURCE_TYPE sourceType, int width, int height)
 
virtual void onFirstRemoteVideoDecoded (conn_id_t connId, uid_t uid, int width, int height, int elapsed)
 
virtual void onVideoSizeChanged (conn_id_t connId, uid_t uid, int width, int height, int rotation)
 
virtual void onLocalVideoStateChanged (conn_id_t connId, LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR errorCode)
 
virtual void onRemoteVideoStateChanged (conn_id_t connId, uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
 
virtual void onFirstRemoteVideoFrame (conn_id_t connId, uid_t uid, int width, int height, int elapsed)
 
virtual void onUserJoined (conn_id_t connId, uid_t uid, int elapsed)
 
virtual void onUserOffline (conn_id_t connId, uid_t uid, USER_OFFLINE_REASON_TYPE reason)
 
virtual void onUserMuteVideo (conn_id_t connId, uid_t uid, bool muted)
 
virtual void onUserEnableVideo (conn_id_t connId, uid_t uid, bool enabled)
 
virtual void onUserEnableLocalVideo (conn_id_t connId, uid_t uid, bool enabled)
 
virtual void onApiCallExecuted (conn_id_t connId, int err, const char *api, const char *result)
 
virtual void onLocalAudioStats (conn_id_t connId, const LocalAudioStats &stats)
 
virtual void onRemoteAudioStats (conn_id_t connId, const RemoteAudioStats &stats)
 
virtual void onLocalVideoStats (conn_id_t connId, const LocalVideoStats &stats)
 
virtual void onRemoteVideoStats (conn_id_t connId, const RemoteVideoStats &stats)
 
virtual void onCameraReady (conn_id_t connId)
 
virtual void onCameraFocusAreaChanged (conn_id_t connId, int x, int y, int width, int height)
 
virtual void onCameraExposureAreaChanged (conn_id_t connId, int x, int y, int width, int height)
 
virtual void onVideoStopped (conn_id_t connId)
 
virtual void onAudioMixingStateChanged (conn_id_t connId, AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode)
 
virtual void onConnectionLost (conn_id_t connId)
 
virtual void onConnectionInterrupted (conn_id_t connId)
 
virtual void onConnectionBanned (conn_id_t connId)
 
virtual void onRefreshRecordingServiceStatus (conn_id_t connId, int status)
 
virtual void onStreamMessage (conn_id_t connId, uid_t uid, int streamId, const char *data, size_t length)
 
virtual void onStreamMessage (uid_t uid, int streamId, const char *data, size_t length, uint64_t sentTs)
 
virtual void onStreamMessageError (conn_id_t connId, uid_t uid, int streamId, int code, int missed, int cached)
 
virtual void onMediaEngineLoadSuccess (conn_id_t connId)
 
virtual void onMediaEngineStartCallSuccess (conn_id_t connId)
 
virtual void onRequestToken (conn_id_t connId)
 
virtual void onTokenPrivilegeWillExpire (conn_id_t connId, const char *token)
 
virtual void onFirstLocalAudioFramePublished (conn_id_t connId, int elapsed)
 
virtual void onLocalAudioStateChanged (conn_id_t connId, LOCAL_AUDIO_STREAM_STATE state, LOCAL_AUDIO_STREAM_ERROR error)
 
virtual void onRemoteAudioStateChanged (conn_id_t connId, uid_t uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_STATE_REASON reason, int elapsed)
 
virtual void onActiveSpeaker (conn_id_t connId, uid_t uid)
 
virtual void onClientRoleChanged (conn_id_t connId, CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole)
 
virtual void onAudioDeviceVolumeChanged (conn_id_t connId, MEDIA_DEVICE_TYPE deviceType, int volume, bool muted)
 
virtual void onRtmpStreamingStateChanged (conn_id_t connId, const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_ERROR errCode)
 
virtual void onStreamPublished (conn_id_t connId, const char *url, int error)
 
virtual void onStreamUnpublished (conn_id_t connId, const char *url)
 
virtual void onTranscodingUpdated (conn_id_t connId)
 
virtual void onStreamInjectedStatus (conn_id_t connId, const char *url, uid_t uid, int status)
 
virtual void onAudioRoutingChanged (conn_id_t connId, int routing)
 
virtual void onChannelMediaRelayStateChanged (conn_id_t connId, int state, int code)
 
virtual void onChannelMediaRelayEvent (conn_id_t connId, int code)
 
virtual void onLocalPublishFallbackToAudioOnly (conn_id_t connId, bool isFallbackOrRecover)
 
virtual void onRemoteSubscribeFallbackToAudioOnly (conn_id_t connId, uid_t uid, bool isFallbackOrRecover)
 
virtual void onRemoteAudioTransportStats (conn_id_t connId, uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate)
 
virtual void onRemoteVideoTransportStats (conn_id_t connId, uid_t uid, unsigned short delay, unsigned short lost, unsigned short rxKBitRate)
 
virtual void onConnectionStateChanged (conn_id_t connId, CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
 
virtual void onNetworkTypeChanged (conn_id_t connId, NETWORK_TYPE type)
 
virtual void onEncryptionError (conn_id_t connId, ENCRYPTION_ERROR_TYPE errorType)
 
virtual void onUserAccountUpdated (uid_t uid, const char *userAccount)
 
virtual void onAudioTransportQuality (uid_t uid, unsigned int bitrate, unsigned short delay, unsigned short lost)
 
virtual void onVideoTransportQuality (uid_t uid, unsigned int bitrate, unsigned short delay, unsigned short lost)
 
virtual void onRecap (const char *recapData, int length)
 
virtual void onMediaEngineEvent (int evt)
 
virtual bool onCustomizedSei (const void **content, int *length)
 
virtual void onExtensionEvent (const char *id, const char *key, const char *json_value)
 
virtual void onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onWarning (int warn, const char *msg)
 
virtual void onError (int err, const char *msg)
 
virtual void onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost)
 
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 onAudioMixingFinished ()
 
virtual void onRemoteAudioMixingBegin ()
 
virtual void onRemoteAudioMixingEnd ()
 
virtual void onAudioEffectFinished (int soundId)
 
virtual void onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
 
virtual void onMediaDeviceChanged (int deviceType)
 
virtual void onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
 
virtual void onIntraRequestReceived ()
 
virtual void onLastmileQuality (int quality)
 
virtual void onFirstLocalVideoFrame (int width, int height, int elapsed)
 
virtual void onFirstLocalVideoFramePublished (int elapsed)
 
virtual void onVideoSourceFrameSizeChanged (VIDEO_SOURCE_TYPE sourceType, int width, int height)
 
virtual void onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed)
 
virtual void onVideoSizeChanged (uid_t uid, int width, int height, int rotation)
 
virtual void onLocalVideoStateChanged (LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR error)
 
virtual void onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
 
virtual void onFirstRemoteVideoFrame (uid_t userId, 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 onUserMuteVideo (uid_t userId, bool muted)
 
virtual void onUserEnableVideo (uid_t uid, bool enabled)
 
virtual void onUserEnableLocalVideo (uid_t uid, bool enabled)
 
virtual void onApiCallExecuted (int err, const char *api, const char *result)
 
virtual void onLocalAudioStats (const LocalAudioStats &stats)
 
virtual void onRemoteAudioStats (const RemoteAudioStats &stats)
 
virtual void onLocalVideoStats (const LocalVideoStats &stats)
 
virtual void onRemoteVideoStats (const RemoteVideoStats &stats)
 
virtual void onCameraReady ()
 
virtual void onCameraFocusAreaChanged (int x, int y, int width, int height)
 
virtual void onCameraExposureAreaChanged (int x, int y, int width, int height)
 
virtual void onVideoStopped ()
 
virtual void onAudioMixingStateChanged (AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode)
 
virtual void onConnectionLost ()
 
virtual void onConnectionInterrupted ()
 
virtual void onConnectionBanned ()
 
virtual void onRefreshRecordingServiceStatus (int status)
 
virtual void onStreamMessage (uid_t userId, int streamId, const char *data, size_t length)
 
virtual void onStreamMessageError (uid_t userId, int streamId, int code, int missed, int cached)
 
virtual void onMediaEngineLoadSuccess ()
 
virtual void onMediaEngineStartCallSuccess ()
 
virtual void onRequestToken ()
 
virtual void onTokenPrivilegeWillExpire (const char *token)
 
virtual void onFirstLocalAudioFramePublished (int elapsed)
 
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 onActiveSpeaker (uid_t userId)
 
virtual void onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole)
 
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_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 onAudioRoutingChanged (int routing)
 
virtual void onChannelMediaRelayStateChanged (int state, int code)
 
virtual void onChannelMediaRelayEvent (int code)
 
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 onConnectionStateChanged (CONNECTION_STATE_TYPE state, CONNECTION_CHANGED_REASON_TYPE reason)
 
virtual void onNetworkTypeChanged (NETWORK_TYPE type)
 
virtual void onEncryptionError (ENCRYPTION_ERROR_TYPE errorType)
 
- Public Member Functions inherited from agora::rtc::IRtcEngineEventHandler
virtual void onJoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onRejoinChannelSuccess (const char *channel, uid_t uid, int elapsed)
 
virtual void onWarning (int warn, const char *msg)
 
virtual void onError (int err, const char *msg)
 
virtual void onAudioQuality (uid_t uid, int quality, unsigned short delay, unsigned short lost)
 
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 onAudioMixingFinished ()
 
virtual void onRemoteAudioMixingBegin ()
 
virtual void onRemoteAudioMixingEnd ()
 
virtual void onAudioEffectFinished (int soundId)
 
virtual void onVideoDeviceStateChanged (const char *deviceId, int deviceType, int deviceState)
 
virtual void onMediaDeviceChanged (int deviceType)
 
virtual void onNetworkQuality (uid_t uid, int txQuality, int rxQuality)
 
virtual void onIntraRequestReceived ()
 
virtual void onUplinkNetworkInfoUpdated (const UplinkNetworkInfo &info)
 
virtual void onDownlinkNetworkInfoUpdated (const DownlinkNetworkInfo &info)
 
virtual void onLastmileQuality (int quality)
 
virtual void onFirstLocalVideoFrame (int width, int height, int elapsed)
 
virtual void onFirstLocalVideoFramePublished (int elapsed)
 
virtual void onVideoSourceFrameSizeChanged (VIDEO_SOURCE_TYPE sourceType, int width, int height)
 
virtual void onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed)
 
virtual void onVideoSizeChanged (uid_t uid, int width, int height, int rotation)
 
virtual void onLocalVideoStateChanged (LOCAL_VIDEO_STREAM_STATE state, LOCAL_VIDEO_STREAM_ERROR error)
 
virtual void onRemoteVideoStateChanged (uid_t uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_STATE_REASON reason, int elapsed)
 
virtual void onFirstRemoteVideoFrame (uid_t userId, 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 onUserMuteVideo (uid_t userId, bool muted)
 
virtual void onUserEnableVideo (uid_t uid, bool enabled)
 
virtual void onUserEnableLocalVideo (uid_t uid, bool enabled)
 
virtual void onApiCallExecuted (int err, const char *api, const char *result)
 
virtual void onLocalAudioStats (const LocalAudioStats &stats)
 
virtual void onRemoteAudioStats (const RemoteAudioStats &stats)
 
virtual void onLocalVideoStats (const LocalVideoStats &stats)
 
virtual void onRemoteVideoStats (const RemoteVideoStats &stats)
 
virtual void onCameraReady ()
 
virtual void onCameraFocusAreaChanged (int x, int y, int width, int height)
 
virtual void onCameraExposureAreaChanged (int x, int y, int width, int height)
 
virtual void onVideoStopped ()
 
virtual void onAudioMixingStateChanged (AUDIO_MIXING_STATE_TYPE state, AUDIO_MIXING_ERROR_TYPE errorCode)
 
virtual void onConnectionLost ()
 
virtual void onConnectionInterrupted ()
 
virtual void onConnectionBanned ()
 
virtual void onRefreshRecordingServiceStatus (int status)
 
virtual void onStreamMessage (uid_t userId, int streamId, const char *data, size_t length)
 
virtual void onStreamMessageError (uid_t userId, int streamId, int code, int missed, int cached)
 
virtual void onMediaEngineLoadSuccess ()
 
virtual void onMediaEngineStartCallSuccess ()
 
virtual void onRequestToken ()
 
virtual void onTokenPrivilegeWillExpire (const char *token)
 
virtual void onFirstLocalAudioFramePublished (int elapsed)
 
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 onActiveSpeaker (uid_t userId)
 
virtual void onClientRoleChanged (CLIENT_ROLE_TYPE oldRole, CLIENT_ROLE_TYPE newRole)
 
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_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 onAudioRoutingChanged (int routing)
 
virtual void onChannelMediaRelayStateChanged (int state, int code)
 
virtual void onChannelMediaRelayEvent (int code)
 
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 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 onLocalUserRegistered (uid_t uid, const char *userAccount)
 
virtual void onUserInfoUpdated (uid_t uid, const UserInfo &info)
 
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 (const char *channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
 

Member Function Documentation

◆ onJoinChannelSuccess() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onJoinChannelSuccess ( conn_id_t  connId,
const char *  channel,
uid_t  uid,
int  elapsed 
)
virtual

when join channel success, the function will be called

Parameters
[in]channelthe channel name you have joined
[in]uidthe uid of you in this channel
[in]elapsedthe time elapsed in ms from the joinChannel been called to joining completed

◆ onRejoinChannelSuccess() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRejoinChannelSuccess ( conn_id_t  connId,
const char *  channel,
uid_t  uid,
int  elapsed 
)
virtual

when join channel success, the function will be called

Parameters
[in]channelthe channel name you have joined
[in]uidthe uid of you in this channel
[in]elapsedthe time elapsed in ms elapsed

◆ onWarning() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onWarning ( conn_id_t  connId,
int  warn,
const char *  msg 
)
virtual

A warning occurs during the SDK runtime.

In most cases, the app can ignore the warnings reported by the SDK, because the SDK can fix the issues and resume running.

Parameters
warnThe warning code.
msgThe detailed warning message: #WARN_CODE_TYPE.

◆ onError() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onError ( conn_id_t  connId,
int  err,
const char *  msg 
)
virtual

An error occurs during the SDK runtime.

Parameters
errThe error code.
msgThe detailed error message: #ERROR_CODE_TYPE.

◆ onAudioQuality() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioQuality ( conn_id_t  connId,
uid_t  uid,
int  quality,
unsigned short  delay,
unsigned short  lost 
)
virtual

when audio quality message come, the function will be called

Parameters
[in]uidthe uid of the peer
[in]qualitythe quality of the remote user, see QUALITY_TYPE for value definition
[in]delaythe average time of the audio packages delayed
[in]lostthe rate of the audio packages lost

◆ onLastmileProbeResult() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLastmileProbeResult ( conn_id_t  connId,
const LastmileProbeResult result 
)
virtual

Reports the result of 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: LastmileProbeResult.

◆ onLeaveChannel() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLeaveChannel ( conn_id_t  connId,
const RtcStats stats 
)
virtual

Occurs when the local user successfully leaves the channel.

When the user successfully leaves the channel after calling leaveChannel, the SDK uses this callback to notify the app that the user has left the channel.

This callback also reports information such as the call duration and the statistics of data received or transmitted by the SDK.

Parameters
statsThe statistics on the call: RtcStats.

◆ onRtcStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRtcStats ( conn_id_t  connId,
const RtcStats stats 
)
virtual

Reports the statistics of the current call.

This callback is triggered once every two seconds after the user joins the channel.

Parameters
statsThe statistics of the current call: RtcStats.

◆ onAudioDeviceStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioDeviceStateChanged ( conn_id_t  connId,
const char *  deviceId,
int  deviceType,
int  deviceState 
)
virtual

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.

◆ onAudioMixingFinished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioMixingFinished ( conn_id_t  connId)
virtual

Occurs when the audio mixing file playback finishes.

Deprecated:
This method is 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.

◆ onVideoDeviceStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onVideoDeviceStateChanged ( conn_id_t  connId,
const char *  deviceId,
int  deviceType,
int  deviceState 
)
virtual

Occurs when the video device state changes.

This callback notifies the application that the system's video device state is changed.

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

◆ onMediaDeviceChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onMediaDeviceChanged ( conn_id_t  connId,
int  deviceType 
)
virtual

Occurs when the device changes.

This callback notifies the application that the system's video device state is changed.

Parameters
deviceTypeDevice type: #MEDIA_DEVICE_TYPE.

◆ onNetworkQuality() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onNetworkQuality ( conn_id_t  connId,
uid_t  uid,
int  txQuality,
int  rxQuality 
)
virtual

report the network quality

Parameters
[in]uidthe uid of the remote user
[in]txQualitythe score of the send network quality 0~5 the higher the better
[in]rxQualitythe score of the recv network quality 0~5 the higher the better

◆ onIntraRequestReceived() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onIntraRequestReceived ( conn_id_t  connId)
virtual

Occurs when intra request from remote user is received.

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

◆ onLastmileQuality() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLastmileQuality ( conn_id_t  connId,
int  quality 
)
virtual

Occurs when network info is updated.

This callback is used for notifying user to adjust the send pace based on the target bitrate.

Parameters
infoThe network info collections. Reports the last-mile network quality of the local user.

This callback is triggered once after startLastmileProbeTest is called.

When the user is not in a channel and the last-mile network test is enabled (by calling startLastmileProbeTest), this callback function is triggered to update the app on the network connection quality of the local user.

Parameters
qualityThe network quality: #QUALITY_TYPE.

◆ onFirstLocalVideoFrame() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstLocalVideoFrame ( conn_id_t  connId,
int  width,
int  height,
int  elapsed 
)
virtual

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

Parameters
widthThe width (pixels) of the video stream.
heightThe height (pixels) of the video stream.
elapsedThe time elapsed (ms) from the local user calling joinChannel until this callback is triggered.

◆ onFirstLocalVideoFramePublished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstLocalVideoFramePublished ( conn_id_t  connId,
int  elapsed 
)
virtual

Occurs when the first local video frame is published.

Parameters
elapsedThe time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback.

◆ onFirstRemoteVideoDecoded() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteVideoDecoded ( conn_id_t  connId,
uid_t  uid,
int  width,
int  height,
int  elapsed 
)
virtual

when the first remote video frame decoded, the function will be called

Parameters
[in]uidthe uid of the remote user
[in]widththe width of the video frame
[in]heightthe height of the video frame
[in]elapsedthe time elapsed from channel joined in ms

◆ onVideoSizeChanged()

virtual void agora::rtc::IRtcEngineEventHandlerEx::onVideoSizeChanged ( conn_id_t  connId,
uid_t  uid,
int  width,
int  height,
int  rotation 
)
virtual

when video size changed or rotation changed, the function will be called

Parameters
[in]uidthe uid of the remote user or local user (0)
[in]widththe new width of the video
[in]heightthe new height of the video
[in]rotationthe rotation of the video

◆ onLocalVideoStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalVideoStateChanged ( conn_id_t  connId,
LOCAL_VIDEO_STREAM_STATE  state,
LOCAL_VIDEO_STREAM_ERROR  errorCode 
)
virtual

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

◆ onRemoteVideoStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoStateChanged ( conn_id_t  connId,
uid_t  uid,
REMOTE_VIDEO_STATE  state,
REMOTE_VIDEO_STATE_REASON  reason,
int  elapsed 
)
virtual

Occurs when the remote video state has changed. REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE is not 100% guaranteed. When the remote user leaves, use onUserOffline to make a business decision.

Parameters
uidID of the user whose video state has changed.
stateThe remote video state: #REMOTE_VIDEO_STATE.
reasonThe reason of the remote video state change: #REMOTE_VIDEO_STATE_REASON.
elapsedThe time elapsed (ms) from the local user calling ref IRtcEngine::joinChannel "joinChannel" until this callback is triggered.

◆ onFirstRemoteVideoFrame() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstRemoteVideoFrame ( conn_id_t  connId,
uid_t  uid,
int  width,
int  height,
int  elapsed 
)
virtual

when the first remote video frame displayed, the function will be called

Parameters
[in]uidthe uid of the remote user
[in]widththe width of the video frame
[in]heightthe height of the video frame
[in]elapsedthe time elapsed from remote user called joinChannel in ms

◆ onUserJoined() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserJoined ( conn_id_t  connId,
uid_t  uid,
int  elapsed 
)
virtual

when any other user joined in the same channel, the function will be called

Parameters
[in]uidthe uid of the remote user
[in]elapsedthe time elapsed from remote used called joinChannel to joining completed in ms

◆ onUserOffline() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserOffline ( conn_id_t  connId,
uid_t  uid,
USER_OFFLINE_REASON_TYPE  reason 
)
virtual

when user offline(exit channel or offline by accident), the function will be called

Parameters
[in]uidthe uid of the remote user

◆ onUserMuteVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserMuteVideo ( conn_id_t  connId,
uid_t  uid,
bool  muted 
)
virtual

when remote user muted the video stream, the function will be called

Deprecated:
Use onRemoteVideoStateChanged instead of.
Parameters
[in]uidthe uid of the remote user
[in]mutedtrue: the remote user muted the video stream, false: the remote user unmuted the video stream

◆ onUserEnableVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserEnableVideo ( conn_id_t  connId,
uid_t  uid,
bool  enabled 
)
virtual

when remote user enable video function, the function will be called

Deprecated:
Use onRemoteVideoStateChanged instead of.
Parameters
[in]uidthe uid of the remote user
[in]enabledtrue: the remote user has enabled video function, false: the remote user has disabled video function

◆ onUserEnableLocalVideo() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onUserEnableLocalVideo ( conn_id_t  connId,
uid_t  uid,
bool  enabled 
)
virtual

when remote user enable local video function, the function will be called

Deprecated:
Use onRemoteVideoStateChanged instead of.
Parameters
[in]uidthe uid of the remote user
[in]enabledtrue: the remote user has enabled local video function, false: the remote user has disabled local video function

◆ onApiCallExecuted() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onApiCallExecuted ( conn_id_t  connId,
int  err,
const char *  api,
const char *  result 
)
virtual

Occurs when an API method is executed.

Parameters
apiThe API method that the SDK executes.
errThe error code that the SDK returns when the method call fails.
resultThe result of the method call.

◆ onLocalAudioStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalAudioStats ( conn_id_t  connId,
const LocalAudioStats stats 
)
virtual

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() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioStats ( conn_id_t  connId,
const RemoteAudioStats stats 
)
virtual

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
statsStatistics of the received remote audio streams. See RemoteAudioStats.

◆ onLocalVideoStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalVideoStats ( conn_id_t  connId,
const LocalVideoStats stats 
)
virtual

Reports the statistics of the local video.

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

Parameters
statsThe statistics of the uploading local video stream: LocalVideoStats.

◆ onRemoteVideoStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoStats ( conn_id_t  connId,
const RemoteVideoStats stats 
)
virtual

Reports the statistics of the remote video.

The SDK triggers this callback once every two seconds for each remote user or broadcaster. If there are multiple users or broadcasters in the channel, the SDK triggers this callback as many times.

Parameters
statsThe statistics of the remote video streams: RemoteVideoStats.

◆ onAudioMixingStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioMixingStateChanged ( conn_id_t  connId,
AUDIO_MIXING_STATE_TYPE  state,
AUDIO_MIXING_ERROR_TYPE  errorCode 
)
virtual

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.

◆ onConnectionLost() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionLost ( conn_id_t  connId)
virtual

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

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

◆ onConnectionInterrupted() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionInterrupted ( conn_id_t  connId)
virtual

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

The SDK triggers this callback when it loses connection with the serer for more than 4 seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. If the reconnection fails within a certain period (10 seconds by default), the onConnectionLost() callback is triggered.

Once the connection is lost, the SDK continues to reconnect until the app calls leaveChannel.

◆ onConnectionBanned() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionBanned ( conn_id_t  connId)
virtual

Occurs when your connection is banned by the Agora Server.

◆ onStreamMessage() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamMessage ( conn_id_t  connId,
uid_t  uid,
int  streamId,
const char *  data,
size_t  length 
)
virtual

when stream message received, the function will be called

Parameters
[in]uiduid of the peer who sends the message
[in]streamIdAPP can create multiple streams for sending messages of different purposes
[in]datathe message data
[in]lengththe message length, in bytes frame rate

◆ onStreamMessageError() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamMessageError ( conn_id_t  connId,
uid_t  uid,
int  streamId,
int  code,
int  missed,
int  cached 
)
virtual

Occurs when the local user fails to receive a remote data stream.

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
uidID of the remote user who sends the data stream.
streamIdThe stream ID.
codeThe error code: #ERROR_CODE_TYPE.
missedThe number of lost messages.
cachedThe number of incoming cached messages when the data stream is interrupted.

◆ onRequestToken() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRequestToken ( conn_id_t  connId)
virtual

Occurs when the token has expired.

If a token is specified when calling the joinChannel method, the token expires after a certain period of time and you need a new token to reconnect to the server.

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

See also
How to generate a token.

◆ onTokenPrivilegeWillExpire() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onTokenPrivilegeWillExpire ( conn_id_t  connId,
const char *  token 
)
virtual

Occurs when the token will expire in 30 seconds.

If the token you specified when calling joinChannel expires, the user will drop offline. This callback is triggered 30 seconds before the token expires, to remind you to renew the token.

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

See also
How to generate a token.
Parameters
tokenThe token that will expire in 30 seconds.

◆ onFirstLocalAudioFramePublished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onFirstLocalAudioFramePublished ( conn_id_t  connId,
int  elapsed 
)
virtual

Occurs when the first local audio frame is published.

Parameters
elapsedThe time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback.

◆ onLocalAudioStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onLocalAudioStateChanged ( conn_id_t  connId,
LOCAL_AUDIO_STREAM_STATE  state,
LOCAL_AUDIO_STREAM_ERROR  error 
)
virtual

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() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioStateChanged ( conn_id_t  connId,
uid_t  uid,
REMOTE_AUDIO_STATE  state,
REMOTE_AUDIO_STATE_REASON  reason,
int  elapsed 
)
virtual

Occurs when the remote audio state changes. REMOTE_AUDIO_STATE_REASON_REMOTE_OFFLINE is not 100% guaranteed. When the remote user leaves, use onUserOffline to make a business decision.

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

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.

◆ onActiveSpeaker() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onActiveSpeaker ( conn_id_t  connId,
uid_t  uid 
)
virtual
Parameters
[in]uidthe speaker uid who is talking in the channel

◆ onClientRoleChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onClientRoleChanged ( conn_id_t  connId,
CLIENT_ROLE_TYPE  oldRole,
CLIENT_ROLE_TYPE  newRole 
)
virtual

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

Parameters
oldRoleThe old role of the user: #CLIENT_ROLE_TYPE.
newRoleThe new role of the user: #CLIENT_ROLE_TYPE.

◆ onAudioDeviceVolumeChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioDeviceVolumeChanged ( conn_id_t  connId,
MEDIA_DEVICE_TYPE  deviceType,
int  volume,
bool  muted 
)
virtual

Occurs when the audio device volume changes.

Parameters
deviceTypeThe device type, see #MEDIA_DEVICE_TYPE
volumeThe volume of the audio device.
mutedWhether the audio device is muted:
  • true: The audio device is muted.
  • false: The audio device is not muted.

◆ onRtmpStreamingStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRtmpStreamingStateChanged ( conn_id_t  connId,
const char *  url,
RTMP_STREAM_PUBLISH_STATE  state,
RTMP_STREAM_PUBLISH_ERROR  errCode 
)
virtual

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: #RTMP_STREAM_PUBLISH_ERROR.

◆ onStreamUnpublished() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamUnpublished ( conn_id_t  connId,
const char *  url 
)
virtual

Reports the result of calling the removePublishStreamUrl() method.

Deprecated:
Use onRtmpStreamingStateChanged instead.

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

Parameters
urlThe RTMP URL address.

◆ onTranscodingUpdated() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onTranscodingUpdated ( conn_id_t  connId)
virtual

Occurs when the publisher's transcoding settings are updated.

When the LiveTranscoding class in setLiveTranscoding updates, the SDK triggers this callback to report the update information.

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

◆ onStreamInjectedStatus() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onStreamInjectedStatus ( conn_id_t  connId,
const char *  url,
uid_t  uid,
int  status 
)
virtual

Reports the status of injecting the online media stream.

Parameters
urlThe URL address of theinjected stream.
uidThe user ID.
statusStatus of the injected stream: #INJECT_STREAM_STATUS.

◆ onAudioRoutingChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onAudioRoutingChanged ( conn_id_t  connId,
int  routing 
)
virtual

Occurs when the local audio route changes (for Android and iOS only).

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

Parameters
routingAudio output routing:
  • -1: Default.
  • 0: Headset.
  • 1: Earpiece.
  • 2: Headset with no microphone.
  • 3: Speakerphone.
  • 4: Loudspeaker.
  • 5: Bluetooth headset.

◆ onRemoteAudioTransportStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteAudioTransportStats ( conn_id_t  connId,
uid_t  uid,
unsigned short  delay,
unsigned short  lost,
unsigned short  rxKBitRate 
)
virtual

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

This callback is triggered every two seconds once the user has received the audio data packet sent from a remote user.

Parameters
uidID of the remote user whose audio data packet is received.
delayThe network time delay (ms) from the remote user sending the audio packet to the local user.
lostThe Packet loss rate (%) of the audio packet sent from the remote user.
rxKBitRateReceived bitrate (Kbps) of the audio packet sent from the remote user.

◆ onRemoteVideoTransportStats() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onRemoteVideoTransportStats ( conn_id_t  connId,
uid_t  uid,
unsigned short  delay,
unsigned short  lost,
unsigned short  rxKBitRate 
)
virtual

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

This callback is triggered every two seconds once the user has received the video data packet sent from a remote user.

Parameters
uidID of the remote user whose video packet is received.
delayThe network time delay (ms) from the remote user sending the video packet to the local user.
lostThe packet loss rate (%) of the video packet sent from the remote user.
rxKBitRateThe Received bitrate (Kbps) of the video packet sent from the remote user.

◆ onConnectionStateChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onConnectionStateChanged ( conn_id_t  connId,
CONNECTION_STATE_TYPE  state,
CONNECTION_CHANGED_REASON_TYPE  reason 
)
virtual

Occurs when the connection state of the SDK to the server is changed.

Parameters
stateSee #CONNECTION_STATE_TYPE.
reasonSee #CONNECTION_CHANGED_REASON_TYPE.

◆ onNetworkTypeChanged() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onNetworkTypeChanged ( conn_id_t  connId,
NETWORK_TYPE  type 
)
virtual

Occurs when the network type is changed.

Parameters
typeSee #NETWORK_TYPE.

◆ onEncryptionError() [1/2]

virtual void agora::rtc::IRtcEngineEventHandlerEx::onEncryptionError ( conn_id_t  connId,
ENCRYPTION_ERROR_TYPE  errorType 
)
virtual

Reports the error type of encryption.

Parameters
typeSee #ENCRYPTION_ERROR_TYPE.

◆ onJoinChannelSuccess() [2/2]

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

Occurs when the local user successfully joins the specified channel.

Parameters
channelThe channel name.
uidThe user ID.
  • If you specified a uid in the joinChannel method, the SDK returns the specified ID;
  • If not, this callback returns an ID that is automatically assigned by the Agora server.
elapsedThe time elapsed (ms) from the local user calling joinChannel until this event occurs.

◆ onRejoinChannelSuccess() [2/2]

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

Occurs when the local user rejoins the channel after being disconnected due to network problems.

When the app loses connection with the server because of network problems, the SDK automatically tries to reconnect to the server, and triggers this callback method upon reconnection.

Parameters
channelThe channel name.
uidThe user ID.
elapsedTime elapsed (ms) from starting to reconnect until this callback is triggered.

◆ onWarning() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onWarning

A warning occurs during the SDK runtime.

In most cases, the app can ignore the warnings reported by the SDK, because the SDK can fix the issues and resume running.

Parameters
warnThe warning code.
msgThe detailed warning message: #WARN_CODE_TYPE.

◆ onError() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onError

An error occurs during the SDK runtime.

Parameters
errThe error code.
msgThe detailed error message: #ERROR_CODE_TYPE.

◆ onAudioQuality() [2/2]

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

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

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

Parameters
uidThe user ID of the speaker.
qualityThe audio quality of the user: #QUALITY_TYPE
delayThe time delay (ms) of the audio packet from the sender to the receiver.
lostThe audio packet loss rate (%) from the sender to the receiver.

◆ onLastmileProbeResult() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLastmileProbeResult

Reports the result of 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: LastmileProbeResult.

◆ onAudioVolumeIndication()

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

Reports which users are speaking and the speaker‘s volume.

This callback reports the IDs and volumes of the loudest speakers at the moment in the channel, and whether the local user is speaking. 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.

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 does not include information of this remote user; 20 seconds after all remote users call the muteLocalAudioStream method, the SDK stops triggering the remote speakers' callback.
Parameters
speakersAn array containing the user ID and volume information for each speaker: AudioVolumeInfo.
  • In the local user's callback, this array contains the following members:
    • uid = 0,
    • volume = totalVolume, which reports the sum of the voice volume and audio-mixing volume of the local user.
  • In the remote users' callback, this array contains the following members:

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

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

speakerNumberThe total number of speakers. The value range is [0, 3].
  • In the local user's callback, speakerNumber = ‘, 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.
totalVolumeThe total volume after audio mixing. The value ranges between 0 (the lowest volume) and 255 (the 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 users' callback, totalVolume is the sum of the voice volume and audio-mixing volume of all the remote speakers.

◆ onLeaveChannel() [2/2]

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

Occurs when the local user successfully leaves the channel.

When the user successfully leaves the channel after calling leaveChannel, the SDK uses this callback to notify the app that the user has left the channel.

This callback also reports information such as the call duration and the statistics of data received or transmitted by the SDK.

Parameters
statsThe statistics on the call: RtcStats.

◆ onRtcStats() [2/2]

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

Reports the statistics of the current call.

This callback is triggered once every two seconds after the user joins the channel.

Parameters
statsThe statistics of the current call: RtcStats.

◆ onAudioDeviceStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioDeviceStateChanged

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.

◆ onAudioMixingFinished() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingFinished

Occurs when the audio mixing file playback finishes.

Deprecated:
This method is 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.

◆ onVideoDeviceStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onVideoDeviceStateChanged

Occurs when the video device state changes.

This callback notifies the application that the system's video device state is changed.

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

◆ onMediaDeviceChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onMediaDeviceChanged

Occurs when the device changes.

This callback notifies the application that the system's video device state is changed.

Parameters
deviceTypeDevice type: #MEDIA_DEVICE_TYPE.

◆ onNetworkQuality() [2/2]

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

Reports the network quality of each user.

This callback is triggered once every two seconds after the user joins the channel.

Parameters
uidThe user ID. If uid is 0, the SDK reports the local network quality.
txQualityThe transmission quality of the user: #QUALITY_TYPE.
rxQualityThe receiving quality of the user: #QUALITY_TYPE.

◆ onIntraRequestReceived() [2/2]

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

Occurs when intra request from remote user is received.

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

◆ onLastmileQuality() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onLastmileQuality

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

This callback is triggered once after startLastmileProbeTest is called.

When the user is not in a channel and the last-mile network test is enabled (by calling startLastmileProbeTest), this callback function is triggered to update the app on the network connection quality of the local user.

Parameters
qualityThe network quality: #QUALITY_TYPE.

◆ onFirstLocalVideoFrame() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onFirstLocalVideoFrame

Occurs when the first local video frame is 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.

◆ onFirstLocalVideoFramePublished() [2/2]

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

Occurs when the first local video frame is published.

Parameters
elapsedThe time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback.

◆ onFirstRemoteVideoDecoded() [2/2]

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

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

Deprecated:
This callback is deprecated since v3.1.200. Use onRemoteVideoStateChanged instead.

This callback is triggered upon the SDK receiving and successfully decoding the first video frame from a remote video. The app can configure the user view settings in this callback.

Parameters
uidID of the user whose video streams are received.
widthThe width (pixels) of the video stream.
heightThe height (pixels) of the video stream.
elapsedThe time elapsed (ms) from the local user calling joinChannel until this callback is triggered.

◆ onLocalVideoStateChanged() [2/2]

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

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

◆ onRemoteVideoStateChanged() [2/2]

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

Occurs when the remote video state has changed.

Note
This callback does not work properly when the number of users (in the COMMUNICATION profile) or hosts (in the LIVE_BROADCASTING profile) in the channel exceeds 17.
Parameters
userIdID of the user whose video state has changed.
stateThe remote video state: #REMOTE_VIDEO_STATE.
reasonThe reason of the remote video state change: #REMOTE_VIDEO_STATE_REASON.
elapsedThe time elapsed (ms) from the local client calling joinChannel until this callback is triggered.

◆ onFirstRemoteVideoFrame() [2/2]

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

Occurs when the first remote video frame is rendered.

The SDK triggers this callback when the first frame of the remote video is rendered 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 rendered.

Parameters
userIdID 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.

◆ onUserJoined() [2/2]

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

Occurs when a remote user or broadcaster joins the channel.

If other users are already in the channel, the SDK also reports to the app on the existing users.

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

  • A broadcaster joins the channel by calling joinChannel.
  • A remote user switches the user role to broadcaster by calling setClientRole after joining the channel.
  • A remote user or broadcaster rejoins the channel after a network interruption.
Note
When a Web app joins the channel, this callback is triggered as long as the app publishes a stream.
Parameters
uidID of the remote user or broadcaster joining the channel.
elapsedThe time elapsed (ms) from the local user calling joinChannel or setClientRole until this callback is triggered.

◆ onUserOffline() [2/2]

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

Occurs when a remote user or broadcaster goes offline.

There are two reasons for a user to go offline:

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

◆ onUserMuteVideo() [2/2]

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

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

Deprecated:
This callback is deprecated since v3.1.200. Use onRemoteVideoStateChanged instead.
Note
This callback is invalid when the number of users or broadacasters in a channel exceeds 20.
Parameters
uidID of the remote user.
muted
  • True: The remote user has paused sending the video stream.
  • False: The remote user has resumed sending the video stream.

◆ onUserEnableVideo() [2/2]

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

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

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

Deprecated:
This callback is deprecated since v3.1.200. Use onRemoteVideoStateChanged instead.
Note
This callback is invalid when the number of users or broadcasters in a channel exceeds 20.
Parameters
uidID of the remote user.
enabled
  • True: The remote user has enabled the video module.
  • False: The remote user has disabled the video module.

◆ onUserEnableLocalVideo() [2/2]

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

Occurs when a remote user enables or disables the local video function.

Deprecated:
This callback is deprecated since v3.1.200. Use onRemoteVideoStateChanged instead.
Parameters
uidID of the remote user.
enabled
  • True: The remote user has enabled the local video function.
  • False: The remote user has disabled the local video function.

◆ onApiCallExecuted() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onApiCallExecuted

Occurs when an API method is executed.

Parameters
apiThe API method that the SDK executes.
errThe error code that the SDK returns when the method call fails.
resultThe result of the method call.

◆ onLocalAudioStats() [2/2]

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

Reports the statistics of the local audio stream.

The SDK triggers this callback once every two seconds.

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

◆ onRemoteAudioStats() [2/2]

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

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
statsStatistics of the received remote audio streams. See RemoteAudioStats.

◆ onLocalVideoStats() [2/2]

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

Reports the statistics of the local video stream.

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

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

◆ onRemoteVideoStats() [2/2]

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

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.

◆ onAudioMixingStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioMixingStateChanged

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.

◆ onConnectionLost() [2/2]

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

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

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

◆ onConnectionInterrupted() [2/2]

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

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

The SDK triggers this callback when it loses connection with the serer for more than 4 seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. If the reconnection fails within a certain period (10 seconds by default), the onConnectionLost() callback is triggered.

Once the connection is lost, the SDK continues to reconnect until the app calls leaveChannel.

◆ onConnectionBanned() [2/2]

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

Occurs when your connection is banned by the Agora Server.

◆ onStreamMessage() [2/2]

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

Occurs when the user receives the data stream.

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

Parameters
userIdID of the user who sends the data stream.
streamIdThe ID of the stream data.
dataThe data stream.
lengthThe length (byte) of the data stream.

◆ onStreamMessageError() [2/2]

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

Occurs when the user fails to receive the data stream.

The SDK triggers this callback when the user does not receive the data stream that another user sends by calling the sendStreamMessage method within 5 seconds.

Parameters
userIdID of the user who sends the data stream.
streamIdThe ID of the stream data.
codeThe error code: #ERROR_CODE_TYPE.
missedThe number of lost messages.
cachedThe number of incoming cached messages when the data stream is interrupted.

◆ onRequestToken() [2/2]

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

Occurs when the token has expired.

If a token is specified when calling the joinChannel method, the token expires after a certain period of time and you need a new token to reconnect to the server.

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

See also
How to generate a token.

◆ onTokenPrivilegeWillExpire() [2/2]

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

Occurs when the token will expire in 30 seconds.

If the token you specified when calling joinChannel expires, the user will drop offline. This callback is triggered 30 seconds before the token expires, to remind you to renew the token.

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

See also
How to generate a token.
Parameters
tokenThe token that will expire in 30 seconds.

◆ onFirstLocalAudioFramePublished() [2/2]

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

Occurs when the first local audio frame is published.

Parameters
elapsedThe time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback.

◆ onLocalAudioStateChanged() [2/2]

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

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() [2/2]

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

Occurs when the remote audio state changes.

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

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.

◆ onActiveSpeaker() [2/2]

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

Occurs when an active speaker is detected.

If you have called the enableAudioVolumeIndication() method, this callback is triggered when the volume detecting unit has detected an active speaker in the channel. This callback also returns the uid of the active speaker.

You can add relative functions on your app, for example, the active speaker, once detected, will have the portrait zoomed in.

Note
  • You need to call enableAudioVolumeIndication() to receive this callback.
  • The active speaker means the user ID of the speaker who speaks at the highest volume during a certain period of time.
Parameters
uidThe ID of the active speaker. A uid of 0 means the local user.

◆ onClientRoleChanged() [2/2]

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

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

Parameters
oldRoleThe old role of the user: #CLIENT_ROLE_TYPE.
newRoleThe new role of the user: #CLIENT_ROLE_TYPE.

◆ onAudioDeviceVolumeChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioDeviceVolumeChanged

Occurs when the audio device volume changes.

Parameters
deviceTypeThe device type, see #MEDIA_DEVICE_TYPE
volumeThe volume of the audio device.
mutedWhether the audio device is muted:
  • true: The audio device is muted.
  • false: The audio device is not muted.

◆ onRtmpStreamingStateChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onRtmpStreamingStateChanged

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: #RTMP_STREAM_PUBLISH_ERROR.

◆ onStreamPublished()

virtual void agora::rtc::IRtcEngineEventHandler::onStreamPublished

Reports the result of calling the addPublishStreamUrl() method.

Deprecated:
Use onRtmpStreamingStateChanged instead.

This callback indicates whether you have successfully added an RTMP stream to the CDN.

Parameters
urlThe RTMP URL address.
errorThe error code. Main errors include:
  • ERR_OK(0): The publishing succeeded.
  • ERR_FAILED(1): The publishing failed.
  • ERR_INVALID_ARGUMENT(2): Invalid argument used. If, for example, you have not called setLiveTranscoding to configure LiveTranscoding before calling addPublishStreamUrl.
  • ERR_TIMEOUT(10): The publishing timed out.
  • ERR_ALREADY_IN_USE(19): The chosen HTTP/HTTPS URL address is already in use for CDN live streaming.
  • ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISHED(130): You cannot publish an encrypted stream.
  • ERR_PUBLISH_STREAM_CDN_ERROR(151): CDN related errors. Remove the original URL address and add a new one by calling the removePublishStreamUrl() and addPublishStreamUrl() methods.
  • ERR_PUBLISH_STREAM_NUM_REACH_LIMIT(152): The host manipulates more than 10 URLs. Delete the unnecessary URLs before adding new ones.
  • ERR_PUBLISH_STREAM_NOT_AUTHORIZED(153): The host manipulates other hosts' URLs. Check your app logic.
  • ERR_PUBLISH_STREAM_INTERNAL_SERVER_ERROR(154): An error occurs in Agora's streaming server. Call the addPublishStreamUrl() method to publish the streaming again.
  • ERR_PUBLISH_STREAM_FORMAT_NOT_SUPPORTED(156): The format of the RTMP stream URL is not supported. Check whether the URL format is correct.

◆ onStreamUnpublished() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onStreamUnpublished

Reports the result of calling the removePublishStreamUrl() method.

Deprecated:
Use onRtmpStreamingStateChanged instead.

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

Parameters
urlThe RTMP URL address.

◆ onTranscodingUpdated() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onTranscodingUpdated

Occurs when the publisher's transcoding settings are updated.

When the LiveTranscoding class in setLiveTranscoding updates, the SDK triggers this callback to report the update information.

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

◆ onStreamInjectedStatus() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onStreamInjectedStatus

Reports the status of injecting the online media stream.

Parameters
urlThe URL address of theinjected stream.
uidThe user ID.
statusStatus of the injected stream: #INJECT_STREAM_STATUS.

◆ onAudioRoutingChanged() [2/2]

virtual void agora::rtc::IRtcEngineEventHandler::onAudioRoutingChanged

Occurs when the local audio route changes (for Android and iOS only).

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

Parameters
routingAudio output routing:
  • -1: Default.
  • 0: Headset.
  • 1: Earpiece.
  • 2: Headset with no microphone.
  • 3: Speakerphone.
  • 4: Loudspeaker.
  • 5: Bluetooth headset.

◆ onChannelMediaRelayStateChanged()

virtual void agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayStateChanged

Occurs when the state of the media stream relay changes.

The SDK reports the state of the current media relay and possible error messages in this callback.

Parameters
stateThe state code:
  • RELAY_STATE_IDLE(0): The SDK is initializing.
  • RELAY_STATE_CONNECTING(1): The SDK tries to relay the media stream to the destination channel.
  • RELAY_STATE_RUNNING(2): The SDK successfully relays the media stream to the destination channel.
  • RELAY_STATE_FAILURE(3): A failure occurs. See the details in code.
codeThe error code:
  • RELAY_OK(0): The state is normal.
  • RELAY_ERROR_SERVER_ERROR_RESPONSE(1): An error occurs in the server response.
  • RELAY_ERROR_SERVER_NO_RESPONSE(2): No server response. You can call the leaveChannel method to leave the channel.
  • RELAY_ERROR_NO_RESOURCE_AVAILABLE(3): The SDK fails to access the service, probably due to limited resources of the server.
  • RELAY_ERROR_FAILED_JOIN_SRC(4): Fails to send the relay request.
  • RELAY_ERROR_FAILED_JOIN_DEST(5): Fails to accept the relay request.
  • RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC(6): The server fails to receive the media stream.
  • RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST(7): The server fails to send the media stream.
  • RELAY_ERROR_SERVER_CONNECTION_LOST(8): The SDK disconnects from the server due to poor network connections. You can call the leaveChannel method to leave the channel.
  • RELAY_ERROR_INTERNAL_ERROR(9): An internal error occurs in the server.
  • RELAY_ERROR_SRC_TOKEN_EXPIRED(10): The token of the source channel has expired.
  • RELAY_ERROR_DEST_TOKEN_EXPIRED(11): The token of the destination channel has expired.

◆ onChannelMediaRelayEvent()

virtual void agora::rtc::IRtcEngineEventHandler::onChannelMediaRelayEvent

Reports events during the media stream relay.

Parameters
codeThe event code for media stream relay:
  • RELAY_EVENT_NETWORK_DISCONNECTED(0): The user disconnects from the server due to poor network connections.
  • RELAY_EVENT_NETWORK_CONNECTED(1): The network reconnects.
  • RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL(2): The user joins the source channel.
  • RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL(3): The user joins the destination channel.
  • RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL(4): The SDK starts relaying the media stream to the destination channel.
  • RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC(5): The server receives the video stream from the source channel.
  • RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC(6): The server receives the audio stream from the source channel.
  • RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL(7): The destination channel is updated.
  • RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED(8): The destination channel update fails due to internal reasons.
  • RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE(9): The destination channel does not change, which means that the destination channel fails to be updated.
  • RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL(10): The destination channel name is NULL.
  • RELAY_EVENT_VIDEO_PROFILE_UPDATE(11): The video profile is sent to the server.

◆ onRemoteAudioTransportStats() [2/2]

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

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

This callback is triggered every two seconds once the user has received the audio data packet sent from a remote user.

Parameters
uidID of the remote user whose audio data packet is received.
delayThe network time delay (ms) from the remote user sending the audio packet to the local user.
lostThe Packet loss rate (%) of the audio packet sent from the remote user.
rxKBitRateReceived bitrate (Kbps) of the audio packet sent from the remote user.

◆ onRemoteVideoTransportStats() [2/2]

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

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

This callback is triggered every two seconds once the user has received the video data packet sent from a remote user.

Parameters
uidID of the remote user whose video packet is received.
delayThe network time delay (ms) from the remote user sending the video packet to the local user.
lostThe packet loss rate (%) of the video packet sent from the remote user.
rxKBitRateThe Received bitrate (Kbps) of the video packet sent from the remote user.

◆ onConnectionStateChanged() [2/2]

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

Occurs when the connection state of the SDK to the server is changed.

Parameters
stateSee #CONNECTION_STATE_TYPE.
reasonSee #CONNECTION_CHANGED_REASON_TYPE.

◆ onNetworkTypeChanged() [2/2]

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

Occurs when the network type is changed.

Parameters
typeSee #NETWORK_TYPE.

◆ onEncryptionError() [2/2]

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

Reports the error type of encryption.

Parameters
typeSee #ENCRYPTION_ERROR_TYPE.