Classes

class  AudioVolumeInfo
 
class  ClientRole
 
class  ErrorCode
 
class  LocalVideoStats
 
class  Quality
 
class  RemoteVideoStats
 
class  RtcStats
 
class  UserOfflineReason
 
class  VideoProfile
 
class  WarnCode
 

Public Member Functions

void onWarning (int warn)
 
void onError (int err)
 
void onJoinChannelSuccess (String channel, int uid, int elapsed)
 
void onRejoinChannelSuccess (String channel, int uid, int elapsed)
 
void onLeaveChannel (RtcStats stats)
 
void onClientRoleChanged (int oldRole, int newRole)
 
void onUserJoined (int uid, int elapsed)
 
void onUserOffline (int uid, int reason)
 
void onConnectionInterrupted ()
 
void onConnectionLost ()
 
void onConnectionBanned ()
 
void onApiCallExecuted (int error, String api, String result)
 
void onTokenPrivilegeWillExpire (String token)
 
void onRequestToken ()
 
void onMicrophoneEnabled (boolean enabled)
 
void onAudioVolumeIndication (AudioVolumeInfo[] speakers, int totalVolume)
 
void onActiveSpeaker (int uid)
 
void onFirstLocalAudioFrame (int elapsed)
 
void onFirstRemoteAudioFrame (int uid, int elapsed)
 
void onVideoStopped ()
 
void onFirstLocalVideoFrame (int width, int height, int elapsed)
 
void onFirstRemoteVideoDecoded (int uid, int width, int height, int elapsed)
 
void onFirstRemoteVideoFrame (int uid, int width, int height, int elapsed)
 
void onUserMuteAudio (int uid, boolean muted)
 
void onUserMuteVideo (int uid, boolean muted)
 
void onUserEnableVideo (int uid, boolean enabled)
 
void onUserEnableLocalVideo (int uid, boolean enabled)
 
void onVideoSizeChanged (int uid, int width, int height, int rotation)
 
void onRemoteVideoStateChanged (int uid, int state)
 
void onLocalPublishFallbackToAudioOnly (boolean isFallbackOrRecover)
 
void onRemoteSubscribeFallbackToAudioOnly (int uid, boolean isFallbackOrRecover)
 
void onAudioRouteChanged (int routing)
 
void onCameraReady ()
 
void onCameraFocusAreaChanged (Rect rect)
 
void onAudioQuality (int uid, int quality, short delay, short lost)
 
void onRtcStats (RtcStats stats)
 
void onLastmileQuality (int quality)
 
void onNetworkQuality (int uid, int txQuality, int rxQuality)
 
void onLocalVideoStats (LocalVideoStats stats)
 
void onRemoteVideoStats (RemoteVideoStats stats)
 
void onLocalVideoStat (int sentBitrate, int sentFrameRate)
 
void onRemoteVideoStat (int uid, int delay, int receivedBitrate, int receivedFrameRate)
 
void onRemoteAudioTransportStats (int uid, int delay, int lost, int rxKBitRate)
 
void onRemoteVideoTransportStats (int uid, int delay, int lost, int rxKBitRate)
 
void onAudioMixingFinished ()
 
void onAudioEffectFinished (int soundId)
 
void onStreamPublished (String url, int error)
 
void onStreamUnpublished (String url)
 
void onTranscodingUpdated ()
 
void onStreamInjectedStatus (String url, int uid, int status)
 
void onStreamMessage (int uid, int streamId, byte[] data)
 
void onStreamMessageError (int uid, int streamId, int error, int missed, int cached)
 
void onMediaEngineLoadSuccess ()
 
void onMediaEngineStartCallSuccess ()
 

Detailed Description

Callbacks.

The SDK uses the IRtcEngineEventHandler interface class to send callbacks to the application, and the application inherits the methods of this interface class to retrieve these callbacks. All methods in this interface class have their (empty) default implementations, and the application can inherit only some of the required events instead of all of them. In the callbacks, the application should avoid time-consuming tasks or call blocking APIs (such as SendMessage), otherwise, the SDK may not work properly.

Member Function Documentation

◆ onWarning()

void io.agora.rtc.IRtcEngineEventHandler.onWarning ( int  warn)

A warning occurs.

In most cases, the app can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running.

For instance, the SDK may report a WARN_LOOKUP_CHANNEL_TIMEOUT warning upon disconnection with the server and tries to reconnect. For detailed warning codes, see Warning Codes.

Parameters
warnWarning code

◆ onError()

void io.agora.rtc.IRtcEngineEventHandler.onError ( int  err)

Occurs when a warning occurs.

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.

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

Parameters
errError code

◆ onJoinChannelSuccess()

void io.agora.rtc.IRtcEngineEventHandler.onJoinChannelSuccess ( String  channel,
int  uid,
int  elapsed 
)

Occurs when a user joins a channel.

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

If the uid is not specified when joinChannel is called, the server automatically assigns a uid.

Parameters
channelChannel name.
uidUser ID.
elapsedTime elapsed (ms) from the user calling joinChannel until this callback is triggered.

◆ onRejoinChannelSuccess()

void io.agora.rtc.IRtcEngineEventHandler.onRejoinChannelSuccess ( String  channel,
int  uid,
int  elapsed 
)

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

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

Parameters
channelChannel name.
uidUser ID.
elapsedTime elapsed (ms) from starting to reconnect until this callback is triggered.

◆ onLeaveChannel()

void io.agora.rtc.IRtcEngineEventHandler.onLeaveChannel ( RtcStats  stats)

Occurs when a user leaves the channel or goes.

When the app calls the leaveChannel method, the SDK uses this callback to notify the app that the user has left the channel.

With this callback, the application retrieves the channel information, such as the call duration and statistics.

Parameters
statsStatistics of the call: RtcStats

◆ onClientRoleChanged()

void io.agora.rtc.IRtcEngineEventHandler.onClientRoleChanged ( int  oldRole,
int  newRole 
)

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

Parameters
oldRoleRole that the user switched from.
newRoleRole that the user switched to.

◆ onUserJoined()

void io.agora.rtc.IRtcEngineEventHandler.onUserJoined ( int  uid,
int  elapsed 
)

Occurs when a remote user/the host joins the channel.

  • Communication mode: This callback notifies the app that another user has joined the channel. If other users are already in the channel, the SDK also reports to the app on the existing users.
  • Live-broadcast mode: This callback notifies the app that the host has joined the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. Agora recommends having at most 17 hosts in a channel
Parameters
uidID of the user or host who has joined the channel.
elapsedTime delay (ms) from the user calling joinChannel/setClientRole until this callback is triggered.
Note
In the live-broadcast mode:
  • The host receives the onUserJoined callback when another host joins the channel.
  • The audience in the channel receives the onUserJoined callback when a new host joins the channel.
  • When a web application joins the channel, the onUserJoined callback is triggered as long as the web application publishes streams.

◆ onUserOffline()

void io.agora.rtc.IRtcEngineEventHandler.onUserOffline ( int  uid,
int  reason 
)

Occurs when a remote user(for communication mode)/host(for live broadcast mode) leaves the channel.

There are two reasons for users to be offline:

  • Leave the channel: when the user/host leaves the channel, the user/host usually sends out a goodbye message. When the message is received, the SDK determines that the user/host has left the channel.
  • Drop offline: when no data package of the user or host is received for a certain period of time(20 seconds for the communication mode, and more for the live broadcast mode), the SDK assumes that the user/host has dropped offline. A poor network connection may lead to false detections, so Agora recommends using the signaling system for reliable offline detection.
Parameters
uidID of the user or host who has left the channel or gone offline.
reasonReason why the user has gone offline:
  • USER_OFFLINE_QUIT(0): The user has left the current channel.
  • USER_OFFLINE_DROPPED(1): The SDK timed out and the user dropped offline because no data packet was received within a certain period of time. If a user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user has dropped offline.
  • USER_OFFLINE_BECOME_AUDIENCE(2): (Live broadcast mode only.) The client role has switched from the host to the audience.

◆ onConnectionInterrupted()

void io.agora.rtc.IRtcEngineEventHandler.onConnectionInterrupted ( )

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

This callback is triggered when the SDK loses connection with the server for more than 4 seconds after the connection is established. After triggering this callback, the SDK will try to reconnect with the server. Developers can use this event as a UI reminder. This callback event is different from onConnectionLost:

  • The onConnectionInterrupted callback is triggered when the SDK loses connection with the server for more than 4 seconds, after the SDK has successfully joined the channel.
  • The onConnectionLost callback is triggered when the SDK loses connection with the server for more than 10 seconds, regardless of whether the SDK has joined the channel or not.

Whichever callback is triggered, the SDK tries to reconnect to the server until the application calls leaveChannel.

◆ onConnectionLost()

void io.agora.rtc.IRtcEngineEventHandler.onConnectionLost ( )

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

This callback is triggered when the SDK cannot connect with the server for 10 seconds after calling joinChannel(), regardless of whether the SDK is in the channel or not.

This callback event is different from onConnectionInterrupted:

  • The onConnectionInterrupted callback is triggered when the SDK loses connection with the server for more than 4 seconds, after the SDK has successfully joined the channel.
  • The onConnectionLost callback is triggered when the SDK loses connection with the server for more than 10 seconds, regardless of whether the SDK has joined the channel or not.

Whichever callback is triggered, the SDK tries to reconnect to the server until the application calls leaveChannel.

◆ onConnectionBanned()

void io.agora.rtc.IRtcEngineEventHandler.onConnectionBanned ( )

Occurs when your connection is banned by the Agora Server.

◆ onApiCallExecuted()

void io.agora.rtc.IRtcEngineEventHandler.onApiCallExecuted ( int  error,
String  api,
String  result 
)

Occurs when an API method is executed.

Parameters
errorError Code that the SDK returns when the method call fails. If the SDK returns 0, then the method call was successful.
apiThe method executed by the SDK.
resultThe result of the method call.

◆ onTokenPrivilegeWillExpire()

void io.agora.rtc.IRtcEngineEventHandler.onTokenPrivilegeWillExpire ( String  token)

Occurs when the Token will expire in 30 seconds.

The user will become offline if the token used in joinChannel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call renewToken to pass the new token to the SDK.

Parameters
tokenThe token that will expire in 30 seconds.

◆ onRequestToken()

void io.agora.rtc.IRtcEngineEventHandler.onRequestToken ( )

Occurs when the Token expires.

After a token is specified by calling joinChannel, if the SDK losses connection with the Agora server due to network issues, the token may expire after a certain period of time and a new token may be required to reconnect to the server. This callback notifies the app to generate a new token. Call renewToken to renew the token. In previous SDKs, this function was provided in the onError callback, in the ERR_TOKEN_EXPIRED(109) and ERR_INVALID_TOKEN(110) errors. Starting from v1.7.3 of the SDK, the old method is still valid, but it is recommended to use the onRequestToken() callback.

◆ onMicrophoneEnabled()

void io.agora.rtc.IRtcEngineEventHandler.onMicrophoneEnabled ( boolean  enabled)

Occurs when the state of the microphone is changed.

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

◆ onAudioVolumeIndication()

void io.agora.rtc.IRtcEngineEventHandler.onAudioVolumeIndication ( AudioVolumeInfo []  speakers,
int  totalVolume 
)

Reports which user is speaking and the speaker's volume.

This callback is disabled by default and can be enabled by the enableAudioVolumeIndication method.

Parameters
speakersAn array containing the user ID and volume information for each speaker: AudioVolumeInfo
totalVolumeTotal volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
Note
In the returned speaker's array:
  • If the uid is 0 (the local user is the speaker), the returned volume is the totalVolume.
  • If the uid is not 0 and the volume is 0, the specified user did not speak.
  • If a uid is contained in the previous speakers array but not in the current speakers array, the specified user did not speak.

◆ onActiveSpeaker()

void io.agora.rtc.IRtcEngineEventHandler.onActiveSpeaker ( int  uid)

Reports which user is speaking in the channel.

If the user has enabled the audio volume indication by calling enableAudioVolumeIndication, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK.

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

◆ onFirstLocalAudioFrame()

void io.agora.rtc.IRtcEngineEventHandler.onFirstLocalAudioFrame ( int  elapsed)

Occurs when the first local audio frame is sent.

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

◆ onFirstRemoteAudioFrame()

void io.agora.rtc.IRtcEngineEventHandler.onFirstRemoteAudioFrame ( int  uid,
int  elapsed 
)

Occurs when the first remote audio frame is received.

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

◆ onVideoStopped()

void io.agora.rtc.IRtcEngineEventHandler.onVideoStopped ( )

Occurs when the video stops playing.

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

◆ onFirstLocalVideoFrame()

void io.agora.rtc.IRtcEngineEventHandler.onFirstLocalVideoFrame ( int  width,
int  height,
int  elapsed 
)

Occurs when the first local video frame is sent.

This callback is triggered after the first local video frame is rendered on the video window.

Parameters
widthWidth (pixels) of the first local video frame.
heightHeight (pixels) of the first local video frame.
elapsedTime elapsed (ms) from the local user calling joinChannel until this callback is triggered. If startPreview is called before joinChannel, elapsed is the time elapsed (ms) from the local user calling startPreview until this callback is triggered.

◆ onFirstRemoteVideoDecoded()

void io.agora.rtc.IRtcEngineEventHandler.onFirstRemoteVideoDecoded ( int  uid,
int  width,
int  height,
int  elapsed 
)

Occurs when the first remote video frame is decoded.

This callback is triggered after the first frame of the remote video has been received and decoded. The app can configure the user view settings with this callback.

Parameters
uidUser ID of the remote user sending the video streams.
widthWidth (pixels) of the video stream.
heightHeight (pixels) of the video stream.
elapsedTime elapsed (ms) from the remote user calling joinChannel until this callback is triggered.

◆ onFirstRemoteVideoFrame()

void io.agora.rtc.IRtcEngineEventHandler.onFirstRemoteVideoFrame ( int  uid,
int  width,
int  height,
int  elapsed 
)

Occurs when the first remote video frame is rendered.

This callback is triggered after the first frame of the remote video has been rendered on the video window. The application can retrieve the data of the time elapsed from the user joining the channel until the first video frame is displayed.

Parameters
uidUser ID of the remote user sending the video streams.
widthWidth (pixels) of the video stream.
heightHeight (pixels) of the video stream.
elapsedTime elapsed (ms) from calling joinChannel until this callback is triggered.

◆ onUserMuteAudio()

void io.agora.rtc.IRtcEngineEventHandler.onUserMuteAudio ( int  uid,
boolean  muted 
)

Occurs when a remote user's audio stream is muted/unmuted.

Parameters
uidID of the remote user.
mutedWhether the remote user's audio stream has muted/unmuted:
  • true: Muted.
  • false: Unmuted.

◆ onUserMuteVideo()

void io.agora.rtc.IRtcEngineEventHandler.onUserMuteVideo ( int  uid,
boolean  muted 
)

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

Parameters
uidID of the remote user.
mutedWhether the remote user's video stream playback has paused/resumed:
  • true: Paused.
  • false: Resumed.
Note
This callback returns invalid when the number of users in a channel exceeds 20.

◆ onUserEnableVideo()

void io.agora.rtc.IRtcEngineEventHandler.onUserEnableVideo ( int  uid,
boolean  enabled 
)

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

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

Parameters
uidUser ID of the remote user.
enabledWhether the specific remote user has enabled/disabled the video function:
  • true: Enabled. The remote user can enter a video session.
  • false: Disabled. The remote user can only enter a voice session, and cannot send or receive any video stream.

◆ onUserEnableLocalVideo()

void io.agora.rtc.IRtcEngineEventHandler.onUserEnableLocalVideo ( int  uid,
boolean  enabled 
)

Occurs when a remote user enables/disables the local video capture.

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

Parameters
uidUser ID of the remote user.
enabledWhether the specific remote user has enabled/disabled the local video function:
  • true: Enabled. Other users in the channel can see the video of this remote user.
  • false: 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.

◆ onVideoSizeChanged()

void io.agora.rtc.IRtcEngineEventHandler.onVideoSizeChanged ( int  uid,
int  width,
int  height,
int  rotation 
)

Occurs when the video size or rotation information of a specified remote user is changed.

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

◆ onRemoteVideoStateChanged()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteVideoStateChanged ( int  uid,
int  state 
)

Occurs when the remote video stream state is changed.

Parameters
uidID of the user whose remote video state has changed.
stateState of the remote video:
  • 1: The remote video is playing normally.
  • 2: The remote video is frozen.
Note
This callback is triggered when the time interval between two video frames exceeds 600 ms (600 ms included).

◆ onLocalPublishFallbackToAudioOnly()

void io.agora.rtc.IRtcEngineEventHandler.onLocalPublishFallbackToAudioOnly ( boolean  isFallbackOrRecover)

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

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

Parameters
isFallbackOrRecoverWhether the locally published stream fell back to audio-only or switched back to the video:
  • true: The locally published stream fell back to audio-only due to poor network conditions.
  • false: The locally published stream switched back to the video after the network conditions improved.

◆ onRemoteSubscribeFallbackToAudioOnly()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteSubscribeFallbackToAudioOnly ( int  uid,
boolean  isFallbackOrRecover 
)

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

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

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

◆ onAudioRouteChanged()

void io.agora.rtc.IRtcEngineEventHandler.onAudioRouteChanged ( int  routing)

Occurs when the local audio pkayout route has changed.

This callback returns that the audio route has switched to an earpiece, speakerphone, headset, or Bluetooth device.

The definition of the routing is listed as follows:

◆ onCameraReady()

void io.agora.rtc.IRtcEngineEventHandler.onCameraReady ( )

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

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

◆ onCameraFocusAreaChanged()

void io.agora.rtc.IRtcEngineEventHandler.onCameraFocusAreaChanged ( Rect  rect)

Occurs when the camera focus area changes.

Parameters
rectRectangular area in the camera zoom specifying the focus area.

◆ onAudioQuality()

void io.agora.rtc.IRtcEngineEventHandler.onAudioQuality ( int  uid,
int  quality,
short  delay,
short  lost 
)

Reports the audio quality of the current call. Triggered once every two seconds.

This callback is enabled by default.

Parameters
uidUser ID of the speaker.
qualityAudio quality of the user:
delayTime delay (ms).
lostAudio packet loss rate (%).

◆ onRtcStats()

void io.agora.rtc.IRtcEngineEventHandler.onRtcStats ( RtcStats  stats)

Reports the statistics of the RtcEngine. Triggered once every two seconds.

Parameters
statsRTC engine statistics: RtcStats

◆ onLastmileQuality()

void io.agora.rtc.IRtcEngineEventHandler.onLastmileQuality ( int  quality)

Reports the last mile network quality of the local user after enableLastmileTest is called.

Parameters
qualityNetwork quality:

◆ onNetworkQuality()

void io.agora.rtc.IRtcEngineEventHandler.onNetworkQuality ( int  uid,
int  txQuality,
int  rxQuality 
)

Reports the network quality of each user. Triigered once every two seconds.

The Agora SDK returns this callback to report on the uplink and downlink network conditions of each user in the channel once every two seconds.

Parameters
uidUser ID. The network quality of the user with this uid will be reported. If uid is 0, the local network quality is reported.
txQualityTransmission quality of the user:
rxQualityReceiving quality of the user:

◆ onLocalVideoStats()

void io.agora.rtc.IRtcEngineEventHandler.onLocalVideoStats ( LocalVideoStats  stats)

Reports the statistics of the uploading local video streams . Triggered once every two seconds.

Parameters
statsStatistics of the uploading local video streams: LocalVideoStats.

◆ onRemoteVideoStats()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteVideoStats ( RemoteVideoStats  stats)

Reports the statistics of the receiving remote video streams. Triggered once every two seconds.

If there are multiple remote users/hosts, this callback is triggered multiple times once every two seconds.

Parameters
statsStatistics of the receiving remote video streams: RemoteVideoStats.

◆ onLocalVideoStat()

void io.agora.rtc.IRtcEngineEventHandler.onLocalVideoStat ( int  sentBitrate,
int  sentFrameRate 
)

Reports the statistics of the uploading local video streams.

Deprecated:
This method is deprecated. Agora recommends using onLocalVideoStats to get the local video statistics.
Parameters
sentBitrateData transmission bitrate (Kbps) since last count.
sentFrameRateData transmission frame rate (fps) since last count.

◆ onRemoteVideoStat()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteVideoStat ( int  uid,
int  delay,
int  receivedBitrate,
int  receivedFrameRate 
)

Reports the statistics of the receiving remote video streams.

Deprecated:
This method is deprecated. Agora recommends using onRemoteVideoStats to get the remote video statistics.
Parameters
uidUser ID of the remote user sending the video streams.
delayTime delay (ms).
receivedBitrateData receiving bitrate (Kbps).
receivedFrameRateData receiving frame rate (fps).

◆ onRemoteAudioTransportStats()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteAudioTransportStats ( int  uid,
int  delay,
int  lost,
int  rxKBitRate 
)

Reports the transport statistics of the remote audio stream. Triggered once every two seconds after the user has received the audio data packet from a remote user.

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

◆ onRemoteVideoTransportStats()

void io.agora.rtc.IRtcEngineEventHandler.onRemoteVideoTransportStats ( int  uid,
int  delay,
int  lost,
int  rxKBitRate 
)

Reports the tranport statistics of the remote video stream. Triggered once every two seconds after the user has received the video data packet from a remote user.

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

◆ onAudioMixingFinished()

void io.agora.rtc.IRtcEngineEventHandler.onAudioMixingFinished ( )

Occurs when the audio mixing file playback finishes.

You can start an audio mixing file playback by calling the startAudioMixing method. This callback is triggered when the audio mixing file playback has finished.

If the startAudioMixing method call fails, an WARN_AUDIO_MIXING_OPEN_ERROR warning returns in the onWarning callback.

◆ onAudioEffectFinished()

void io.agora.rtc.IRtcEngineEventHandler.onAudioEffectFinished ( int  soundId)

Occurs when the audio effect file playback finishes.

You can start a local audio effect playback by calling the playEffect method. This callback is triggered when the local audio effect file playback has finished.

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

◆ onStreamPublished()

void io.agora.rtc.IRtcEngineEventHandler.onStreamPublished ( String  url,
int  error 
)

Occurs when a CDN live stream is published.

Parameters
urlHTTP/HTTPS URL address, to which the publisher publishes the stream.
errorError code

◆ onStreamUnpublished()

void io.agora.rtc.IRtcEngineEventHandler.onStreamUnpublished ( String  url)

Occurs when a CDN live stream stops.

This callback notifies the host that the CDN live stream has been unpublished.

Parameters
urlHTTP/HTTPS URL address, from which the publisher unpublished the stream.

◆ onTranscodingUpdated()

void io.agora.rtc.IRtcEngineEventHandler.onTranscodingUpdated ( )

Occurs when the publisher's transcoding settings are updated.

◆ onStreamInjectedStatus()

void io.agora.rtc.IRtcEngineEventHandler.onStreamInjectedStatus ( String  url,
int  uid,
int  status 
)

Reports the status of the injected online media stream.

Parameters
urlHTTP/HTTPS URL address of the externally injected stream.
uidUser ID.
statusState of the externally injected stream:

◆ onStreamMessage()

void io.agora.rtc.IRtcEngineEventHandler.onStreamMessage ( int  uid,
int  streamId,
byte []  data 
)

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

Parameters
uidUser ID of the remote user sending the message.
streamIdStream ID.
dataData received by the local user.

◆ onStreamMessageError()

void io.agora.rtc.IRtcEngineEventHandler.onStreamMessageError ( int  uid,
int  streamId,
int  error,
int  missed,
int  cached 
)

Occurs when the local user failes to receive the remote data stream.

Parameters
uidUser ID of the remote user sending the message.
streamIdStream ID.
errorError code.
missedThe number of lost messages.
cachedThe number of incoming cached messages when the data stream is interrupted.

◆ onMediaEngineLoadSuccess()

void io.agora.rtc.IRtcEngineEventHandler.onMediaEngineLoadSuccess ( )

Occurs when the media engine is loaded.

◆ onMediaEngineStartCallSuccess()

void io.agora.rtc.IRtcEngineEventHandler.onMediaEngineStartCallSuccess ( )

Occurs when the media engine starts.


The documentation for this class was generated from the following file:
  • src/main/java/io/agora/rtc/IRtcEngineEventHandler.java