IoT SDK for Android v1.8.0
Public Member Functions | List of all members
io.agora.rtc.AgoraRtcEvents Interface Reference

Public Member Functions

void onJoinChannelSuccess (int connId, int uid, int elapsed_ms)
 
void onConnectionLost (int connId)
 
void onRejoinChannelSuccess (int connId, int uid, int elapsed_ms)
 
void onError (int connId, int code, String msg)
 
void onUserJoined (int connId, int uid, int elapsed_ms)
 
void onUserOffline (int connId, int uid, int reason)
 
void onUserMuteAudio (int connId, int uid, boolean muted)
 
void onUserMuteVideo (int connId, int uid, boolean muted)
 
void onKeyFrameGenReq (int connId, int requested_uid, int stream_type)
 
void onAudioData (int connId, int uid, int sent_ts, byte[] data, AudioFrameInfo info)
 
void onMixedAudioData (int connId, byte[] data, AudioFrameInfo info)
 
void onVideoData (int connId, int uid, int sent_ts, byte[] data, VideoFrameInfo info)
 
void onTargetBitrateChanged (int connId, int target_bps)
 
void onTokenPrivilegeWillExpire (int connId, String token)
 

Detailed Description

Event handler.

Member Function Documentation

◆ onAudioData()

void io.agora.rtc.AgoraRtcEvents.onAudioData ( int  connId,
int  uid,
int  sent_ts,
byte[]  data,
AudioFrameInfo  info 
)

Occurs when receiving the audio frame of a remote user in the channel.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
sent_tsUnix timestamp (ms) of the time when the remote user calls sendAudioData to send data.
dataAudio frame buffer.
infoAudio frame information.

◆ onConnectionLost()

void io.agora.rtc.AgoraRtcEvents.onConnectionLost ( int  connId)

Occurs when the local user disconnects from an RTC channel.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.

◆ onError()

void io.agora.rtc.AgoraRtcEvents.onError ( int  connId,
int  code,
String  msg 
)

Occurs when the SDK reports an error.

In most cases, it means the SDK cannot recover from the error and you must take actions accordingly.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
codeError code.
msgError message.

◆ onJoinChannelSuccess()

void io.agora.rtc.AgoraRtcEvents.onJoinChannelSuccess ( int  connId,
int  uid,
int  elapsed_ms 
)

Occurs when the local user joins an RTC channel successfully.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidUser ID.
elapsed_msTime elapsed (ms) since the local user joins an RTC channel.

◆ onKeyFrameGenReq()

void io.agora.rtc.AgoraRtcEvents.onKeyFrameGenReq ( int  connId,
int  requested_uid,
int  stream_type 
)

Occurs when a remote user requests a keyframe.

This callback notifies the sender to generate a new keyframe.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
requested_uidRemote user ID.
stream_typeStream type of the keyframe.

◆ onMixedAudioData()

void io.agora.rtc.AgoraRtcEvents.onMixedAudioData ( int  connId,
byte[]  data,
AudioFrameInfo  info 
)

Occurs when receiving the mixed audio frame of local and remote users. This callback occurs every 20 ms.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
dataAudio frame buffer.
infoAudio frame information.

◆ onRejoinChannelSuccess()

void io.agora.rtc.AgoraRtcEvents.onRejoinChannelSuccess ( int  connId,
int  uid,
int  elapsed_ms 
)

Occurs when the local user rejoins an RTC channel successfully.

When the client disconnects from the RTC channel due to network issues, the SDK reconnects to the RTC channel and triggers this callback if successful.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidUser ID.
elapsed_msTime elapsed (ms) since the local user rejoins an RTC channel.

◆ onTargetBitrateChanged()

void io.agora.rtc.AgoraRtcEvents.onTargetBitrateChanged ( int  connId,
int  target_bps 
)

Occurs when network bandwidth change is detected. Use this callback to adjust your bitrate.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
target_bpsTarget value (bps) that you are recommended to set the bitrate to.

◆ onTokenPrivilegeWillExpire()

void io.agora.rtc.AgoraRtcEvents.onTokenPrivilegeWillExpire ( int  connId,
String  token 
)

Occurs when the RTC token expires in 30 seconds.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
tokenThe RTC token which is about to expire.

If you specify the RTC token when calling joinChannel, the SDK triggers this callback if the RTC token expires in 30 seconds. You must request a new RTC token from your app server, and call renewToken to pass the new RTC token to the SDK.

◆ onUserJoined()

void io.agora.rtc.AgoraRtcEvents.onUserJoined ( int  connId,
int  uid,
int  elapsed_ms 
)

Occurs when a remote user joins an RTC channel successfully.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
elapsed_msTime elapsed (ms) since the remote user joins the RTC channel.

◆ onUserMuteAudio()

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

Occurs when a remote user enables/disables sending audio.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
mutedEnables/disables sending audio.
  • false: Enables sending audio.
  • true: Disables sending audio.

◆ onUserMuteVideo()

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

Occurs when a remote user enables/disables sending video.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
mutedEnables/disables sending video.
  • false: Enables sending video.
  • true: Disables sending video.

◆ onUserOffline()

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

Occurs when a remote user leaves an RTC channel.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
reasonReason why the remote user leaves the RTC channel.
  • USER_OFFLINE_QUIT (0): The remote user leaves the RTC channel by calling leave.
  • USER_OFFLINE_DROPPED (1): The remote user drops offline.

◆ onVideoData()

void io.agora.rtc.AgoraRtcEvents.onVideoData ( int  connId,
int  uid,
int  sent_ts,
byte[]  data,
VideoFrameInfo  info 
)

Occurs when receiving the video frame of a remote user in the channel.

Parameters
connIdConnection ID. A connection can correspond to multiple RTC channels.
uidRemote user ID.
sent_tsTimestamp (ms) for sending data.
dataVideo frame buffer.
infoVideo frame info.

The documentation for this interface was generated from the following file: