Agora Server Gateway SDK Java API Reference
|
Public Member Functions | |
void | onConnected (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info, int reason) |
void | onDisconnected (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info, int reason) |
void | onConnecting (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info, int reason) |
void | onReconnecting (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info, int reason) |
void | onConnectionLost (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info) |
void | onLastmileQuality (AgoraRtcConn agora_rtc_conn, int quality) |
void | onLastmileProbeResult (AgoraRtcConn agora_rtc_conn, LastmileProbeResult result) |
void | onTokenPrivilegeWillExpire (AgoraRtcConn agora_rtc_conn, String token) |
void | onTokenPrivilegeDidExpire (AgoraRtcConn agora_rtc_conn) |
void | onConnectionFailure (AgoraRtcConn agora_rtc_conn, RtcConnInfo conn_info, int reason) |
void | onUserJoined (AgoraRtcConn agora_rtc_conn, String user_id) |
void | onUserLeft (AgoraRtcConn agora_rtc_conn, String user_id, int reason) |
void | onTransportStats (AgoraRtcConn agora_rtc_conn, RtcStats stats) |
void | onChangeRoleSuccess (AgoraRtcConn agora_rtc_conn, int old_role, int new_role) |
void | onChangeRoleFailure (AgoraRtcConn agora_rtc_conn) |
void | onUserNetworkQuality (AgoraRtcConn agora_rtc_conn, String user_id, int tx_quality, int rx_quality) |
void | onNetworkTypeChanged (AgoraRtcConn agora_rtc_conn, int type) |
void | onError (AgoraRtcConn agora_rtc_conn, int error, String msg) |
void | onEncryptionError (AgoraRtcConn agora_rtc_conn, int error_type) |
void | onUploadLogResult (AgoraRtcConn agora_rtc_conn, String request_id, int success, int reason) |
The IRtcConnObserver
interface.
void io.agora.rtc.IRtcConnObserver.onChangeRoleFailure | ( | AgoraRtcConn | agora_rtc_conn | ) |
Occurs when the local user fails to change the user role.
agora_rtc_conn | An AgoraRtcConn object. |
void io.agora.rtc.IRtcConnObserver.onChangeRoleSuccess | ( | AgoraRtcConn | agora_rtc_conn, |
int | old_role, | ||
int | new_role | ||
) |
Occurs when the role of the local user changes.
agora_rtc_conn | An AgoraRtcConn object. |
old_role | The previous role of the local user.
|
new_role | The current role of the local user.
|
void io.agora.rtc.IRtcConnObserver.onConnected | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info, | ||
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora channel changes to CONNECTION_STATE_CONNECTED(3).
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The information of the connection. |
reason | The reason of the connection state change.
|
void io.agora.rtc.IRtcConnObserver.onConnecting | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info, | ||
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora channel changes to 2 (connecting).
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The information of the connection. |
reason | The reason of the connection state change. |
void io.agora.rtc.IRtcConnObserver.onConnectionFailure | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info, | ||
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora channel changes to 5 (failed).
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The connection information. |
reason | The reason of the connection state change. |
void io.agora.rtc.IRtcConnObserver.onConnectionLost | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info | ||
) |
Occurs when the SDK loses connection with the Agora channel.
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The information of the connection. |
void io.agora.rtc.IRtcConnObserver.onDisconnected | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info, | ||
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora channel changes to 1 (disconnected).
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The information of the connection. |
reason | The reason of the connection state change. |
void io.agora.rtc.IRtcConnObserver.onEncryptionError | ( | AgoraRtcConn | agora_rtc_conn, |
int | error_type | ||
) |
Occurs when an error occurs during encryption.
agora_rtc_conn | An AgoraRtcConn object. |
error_type | Type of the error. |
void io.agora.rtc.IRtcConnObserver.onError | ( | AgoraRtcConn | agora_rtc_conn, |
int | error, | ||
String | msg | ||
) |
Reports an error during SDK runtime.
This callback indicates that an error (concerning network or media) occurs during SDK runtime. In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user about the issue.
agora_rtc_conn | An AgoraRtcConn object. |
error | The error code. |
msg | The error description. |
void io.agora.rtc.IRtcConnObserver.onLastmileProbeResult | ( | AgoraRtcConn | agora_rtc_conn, |
LastmileProbeResult | result | ||
) |
Reports the result of the last-mile network probe test.
The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest.
agora_rtc_conn | An AgoraRtcConn object. |
result | The result of the last-mile network probe test: LastmileProbeResult. |
void io.agora.rtc.IRtcConnObserver.onLastmileQuality | ( | AgoraRtcConn | agora_rtc_conn, |
int | quality | ||
) |
Reports the quality of the last-mile network.
The SDK triggers this callback within two seconds after the app calls startLastmileProbeTest.
agora_rtc_conn | An AgoraRtcConn object. |
quality | Quality of the last-mile network.
|
void io.agora.rtc.IRtcConnObserver.onNetworkTypeChanged | ( | AgoraRtcConn | agora_rtc_conn, |
int | type | ||
) |
Occurs when the network type is changed.
agora_rtc_conn | An AgoraRtcConn object. |
type | The current network type.
|
void io.agora.rtc.IRtcConnObserver.onReconnecting | ( | AgoraRtcConn | agora_rtc_conn, |
RtcConnInfo | conn_info, | ||
int | reason | ||
) |
Occurs when the connection state between the SDK and the Agora channel changes to 4 (reconnecting).
agora_rtc_conn | An AgoraRtcConn object. |
conn_info | The information of the connection. |
reason | The reason of the connection state change. |
void io.agora.rtc.IRtcConnObserver.onTokenPrivilegeDidExpire | ( | AgoraRtcConn | agora_rtc_conn | ) |
Occurs when the token has expired.
agora_rtc_conn | An AgoraRtcConn object. Upon receiving this callback, you must generate a new token on your server and connect to the RTC channel with the new token. |
void io.agora.rtc.IRtcConnObserver.onTokenPrivilegeWillExpire | ( | AgoraRtcConn | agora_rtc_conn, |
String | token | ||
) |
Occurs when the token expires in 30 seconds.
The SDK triggers this callback to remind the app to get a new token before the token privilege expires.
Upon receiving this callback, you must generate a new token on your server and call renewToken to pass the new token to the SDK.
agora_rtc_conn | An AgoraRtcConn object. |
token | The pointer to the token that expires in 30 seconds. |
void io.agora.rtc.IRtcConnObserver.onTransportStats | ( | AgoraRtcConn | agora_rtc_conn, |
RtcStats | stats | ||
) |
Reports the transport statistics of the connection.
The SDK triggers this callback once every two seconds when the connection state is 3 (connected).
agora_rtc_conn | An AgoraRtcConn object. |
stats | The transport status. |
void io.agora.rtc.IRtcConnObserver.onUploadLogResult | ( | AgoraRtcConn | agora_rtc_conn, |
String | request_id, | ||
int | success, | ||
int | reason | ||
) |
void io.agora.rtc.IRtcConnObserver.onUserJoined | ( | AgoraRtcConn | agora_rtc_conn, |
String | user_id | ||
) |
Occurs when a remote user joins the channel.
You can get the ID of the remote user in this callback.
agora_rtc_conn | An AgoraRtcConn object. |
user_id | The ID of the remote user who joins the channel. |
void io.agora.rtc.IRtcConnObserver.onUserLeft | ( | AgoraRtcConn | agora_rtc_conn, |
String | user_id, | ||
int | reason | ||
) |
Occurs when a remote user leaves the channel.
You can know why the user leaves the channel through the reason
parameter.
agora_rtc_conn | An AgoraRtcConn object. |
user_id | The ID of the user who leaves the channel. |
reason | The reason of the connection state change. |
void io.agora.rtc.IRtcConnObserver.onUserNetworkQuality | ( | AgoraRtcConn | agora_rtc_conn, |
String | user_id, | ||
int | tx_quality, | ||
int | rx_quality | ||
) |
Reports the network quality of each user.
The SDK triggers this callback once every two seconds to report the uplink and downlink network conditions of each user in the channel, including the local user.
agora_rtc_conn | An AgoraRtcConn object. |
user_id | The ID of the user. If user_id is empty, this callback reports the network quality of the local user. |
tx_quality | The uplink network quality. |
rx_quality | The downlink network quality. |