Agora Java API Reference for Android
|
Public Member Functions | |
void | onWarning (int warn) |
void | onError (int err) |
void | onApiCallExecuted (int error, String api, String result) |
void | onCameraReady () |
void | onCameraFocusAreaChanged (Rect rect) |
void | onCameraExposureAreaChanged (Rect rect) |
void | onContentInspectResult (int result) |
void | onSnapshotTaken (String channel, int uid, String filePath, int width, int height, int errCode) |
void | onFacePositionChanged (int imageWidth, int imageHeight, IRtcEngineEventHandler.AgoraFacePositionInfo[] faceRectArr) |
void | onVideoStopped () |
void | onLeaveChannel (IRtcEngineEventHandler.RtcStats stats) |
void | onRtcStats (IRtcEngineEventHandler.RtcStats stats) |
void | onAudioVolumeIndication (IRtcEngineEventHandler.AudioVolumeInfo[] speakers, int totalVolume) |
void | onLastmileQuality (int quality) |
void | onLastmileProbeResult (IRtcEngineEventHandler.LastmileProbeResult result) |
void | onLocalVideoStat (int sentBitrate, int sentFrameRate) |
void | onRemoteVideoStats (IRtcEngineEventHandler.RemoteVideoStats stats) |
void | onRemoteAudioStats (IRtcEngineEventHandler.RemoteAudioStats stats) |
void | onLocalVideoStats (IRtcEngineEventHandler.LocalVideoStats stats) |
void | onLocalAudioStats (IRtcEngineEventHandler.LocalAudioStats stats) |
void | onFirstLocalVideoFrame (int width, int height, int elapsed) |
void | onConnectionLost () |
void | onConnectionInterrupted () |
void | onConnectionStateChanged (int state, int reason) |
void | onNetworkTypeChanged (int type) |
void | onConnectionBanned () |
void | onRefreshRecordingServiceStatus (int status) |
void | onMediaEngineLoadSuccess () |
void | onMediaEngineStartCallSuccess () |
void | onAudioMixingFinished () |
When audio mixing file playback finished, this callback will be triggered. | |
void | onRequestToken () |
when token is enabled, and specified token is invalid or expired, this function will be called. APP should generate a new token and call renewToken() to refresh the token. NOTE: to be compatible with previous version, ERR_TOKEN_EXPIRED and ERR_INVALID_TOKEN are also reported via onError() callback. You should move renew of token logic into this callback. | |
void | onAudioRouteChanged (int routing) |
: when sdk is responsible for monitoring audio routing, this function will be called by sdk to notify app that audio routing changed. | |
void | onAudioMixingStateChanged (int state, int errorCode) |
void | onFirstLocalAudioFramePublished (int elapsed) |
void | onAudioEffectFinished (int soundId) |
void | onClientRoleChanged (int oldRole, int newRole) |
void | onRtmpStreamingStateChanged (String url, IRtcEngineEventHandler.RTMP_STREAM_PUBLISH_STATE state, IRtcEngineEventHandler.RTMP_STREAM_PUBLISH_ERROR errCode) |
void | onStreamPublished (String url, int error) |
void | onStreamUnpublished (String url) |
void | onTranscodingUpdated () |
void | onTokenPrivilegeWillExpire (String token) |
void | onLocalPublishFallbackToAudioOnly (boolean isFallbackOrRecover) |
void | onChannelMediaRelayStateChanged (int state, int code) |
void | onChannelMediaRelayEvent (int code) |
void | onIntraRequestReceived () |
void | onUplinkNetworkInfoUpdated (IRtcEngineEventHandler.UplinkNetworkInfo info) |
void | onDownlinkNetworkInfoUpdated (IRtcEngineEventHandler.DownlinkNetworkInfo info) |
void | onEncryptionError (IRtcEngineEventHandler.ENCRYPTION_ERROR_TYPE errorType) |
void | onPermissionError (IRtcEngineEventHandler.PERMISSION permission) |
void | onLocalUserRegistered (int uid, String userAccount) |
void | onUserInfoUpdated (int uid, UserInfo info) |
void | onFirstLocalVideoFramePublished (int elapsed) |
void | onAudioSubscribeStateChanged (String channel, int uid, IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE oldState, IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) |
void | onVideoSubscribeStateChanged (String channel, int uid, IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE oldState, IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState) |
void | onAudioPublishStateChanged (String channel, IRtcEngineEventHandler.STREAM_PUBLISH_STATE oldState, IRtcEngineEventHandler.STREAM_PUBLISH_STATE newState, int elapseSinceLastState) |
void | onVideoPublishStateChanged (String channel, IRtcEngineEventHandler.STREAM_PUBLISH_STATE oldState, IRtcEngineEventHandler.STREAM_PUBLISH_STATE newState, int elapseSinceLastState) |
Created by eaglewangy on 29/03/2018.
void io.agora.rtc2.IAgoraEventHandler.onWarning | ( | int | warn | ) |
void io.agora.rtc2.IAgoraEventHandler.onError | ( | int | err | ) |
void io.agora.rtc2.IAgoraEventHandler.onApiCallExecuted | ( | int | error, |
String | api, | ||
String | result | ||
) |
API执行完毕后,该回调会被触发
error | 如果调用失败这里返回错误号,0为成功 |
api | 所调用的API |
result | 调用结果 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onCameraReady | ( | ) |
摄像头设备就绪之后,该回调将被触发
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onCameraFocusAreaChanged | ( | Rect | rect | ) |
void io.agora.rtc2.IAgoraEventHandler.onCameraExposureAreaChanged | ( | Rect | rect | ) |
The camera exposure area has changed.
The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method.
rect | Rectangular area in the camera zoom specifying the exposure area. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onFacePositionChanged | ( | int | imageWidth, |
int | imageHeight, | ||
IRtcEngineEventHandler.AgoraFacePositionInfo[] | faceRectArr | ||
) |
Occurs when the camera exposure area has changed.
imageWidth | width of output image. |
imageHeight | height of output image. |
faceRectArr | Rectangular area in the camera zoom that specifies the focus area. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onVideoStopped | ( | ) |
void io.agora.rtc2.IAgoraEventHandler.onLeaveChannel | ( | IRtcEngineEventHandler.RtcStats | stats | ) |
退出频道的回调
stats | 状态信息 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onRtcStats | ( | IRtcEngineEventHandler.RtcStats | stats | ) |
状态信息回调
stats | 状态信息 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onAudioVolumeIndication | ( | IRtcEngineEventHandler.AudioVolumeInfo[] | speakers, |
int | totalVolume | ||
) |
远端音频流音量强度回调
speakers | 音频信息数组,包含每个远端用户的UID及其音量 |
totalVolume | 所有音频流信息混音后总音量强度 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onLastmileQuality | ( | int | quality | ) |
void io.agora.rtc2.IAgoraEventHandler.onRemoteVideoStats | ( | IRtcEngineEventHandler.RemoteVideoStats | stats | ) |
远端视频流质量回调
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onRemoteAudioStats | ( | IRtcEngineEventHandler.RemoteAudioStats | stats | ) |
远端音频流质量回调
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onLocalVideoStats | ( | IRtcEngineEventHandler.LocalVideoStats | stats | ) |
近端视频流质量回调
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onFirstLocalVideoFrame | ( | int | width, |
int | height, | ||
int | elapsed | ||
) |
当引擎获取到本地首帧视频信息之后,该回调会被调用
width | 帧宽度 |
height | 帧高度 |
elapsed | 此刻距离用户发出登陆请求包的时间间隔 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onConnectionLost | ( | ) |
确认连接不可用后,该回调会被调用
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onConnectionInterrupted | ( | ) |
void io.agora.rtc2.IAgoraEventHandler.onConnectionStateChanged | ( | int | state, |
int | reason | ||
) |
连接状态改变后,该回调会被触发
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onNetworkTypeChanged | ( | int | type | ) |
网络类型改变后,该回调会被触发
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onConnectionBanned | ( | ) |
void io.agora.rtc2.IAgoraEventHandler.onAudioMixingStateChanged | ( | int | state, |
int | errorCode | ||
) |
Occurs when the state of the local user's audio mixing file changes.
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.
state | The state code. See #AUDIO_MIXING_STATE_*. |
errorCode | The error code. See #AUDIO_MIXING_ERROR_*. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onFirstLocalAudioFramePublished | ( | int | elapsed | ) |
当引擎发送本地首帧音频帧时,该回调会被调用
elapsed | 此刻距离用户发出登陆请求包的时间间隔 |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onLocalUserRegistered | ( | int | uid, |
String | userAccount | ||
) |
Occurs when the local user successfully registers a user account by calling the registerLocalUserAccount method or joins a channel by calling the joinChannelWithUserAccount method. This callback reports the user ID and user account of the local user.
uid | The ID of the local user. |
userAccount | The user account of the local user. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onUserInfoUpdated | ( | int | uid, |
UserInfo | info | ||
) |
Occurs when the SDK gets the user ID and user account of the remote user.
After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object (userInfo
), and triggers this callback on the local client.
uid | The ID of the remote user. |
info | The UserInfo object that contains the user ID and user account of the remote user. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onFirstLocalVideoFramePublished | ( | int | elapsed | ) |
Occurs when the first video frame is published.
elapsed | The time elapsed (ms) from the local user calling joinChannel to the SDK triggers this callback. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onAudioSubscribeStateChanged | ( | String | channel, |
int | uid, | ||
IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE | oldState, | ||
IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE | newState, | ||
int | elapseSinceLastState | ||
) |
Occurs when the audio subscribe state changed.
channel | The channel name of user joined. |
uid | The remote user ID that is subscribed to. |
oldState | The old state of the audio stream subscribe : #STREAM_SUBSCRIBE_STATE. |
newState | The new state of the audio stream subscribe : #STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onVideoSubscribeStateChanged | ( | String | channel, |
int | uid, | ||
IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE | oldState, | ||
IRtcEngineEventHandler.STREAM_SUBSCRIBE_STATE | newState, | ||
int | elapseSinceLastState | ||
) |
Occurs when the video subscribe state changed.
channel | The channel name of user joined. |
uid | The remote user ID that is subscribed to. |
oldState | The old state of the video stream subscribe : #STREAM_SUBSCRIBE_STATE. |
newState | The new state of the video stream subscribe : #STREAM_SUBSCRIBE_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onAudioPublishStateChanged | ( | String | channel, |
IRtcEngineEventHandler.STREAM_PUBLISH_STATE | oldState, | ||
IRtcEngineEventHandler.STREAM_PUBLISH_STATE | newState, | ||
int | elapseSinceLastState | ||
) |
Occurs when the audio publish state changed.
channel | The channel name of user joined. |
oldState | The old state of the audio stream publish : #STREAM_PUBLISH_STATE. |
newState | The new state of the audio stream publish : #STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.
void io.agora.rtc2.IAgoraEventHandler.onVideoPublishStateChanged | ( | String | channel, |
IRtcEngineEventHandler.STREAM_PUBLISH_STATE | oldState, | ||
IRtcEngineEventHandler.STREAM_PUBLISH_STATE | newState, | ||
int | elapseSinceLastState | ||
) |
Occurs when the video publish state changed.
channel | The channel name of user joined. |
oldState | The old state of the video stream publish : #STREAM_PUBLISH_STATE. |
newState | The new state of the video stream publish : #STREAM_PUBLISH_STATE. |
elapseSinceLastState | The time elapsed (ms) from the old state to the new state. |
Implemented in io.agora.rtc2.IRtcEngineEventHandler.