|
native String | getVersion () |
|
native String | errToStr (int err) |
|
native String | licenseGenCredential () |
|
native int | licenseVerify (String certificate, String credential) |
|
native int | init (String appId, AgoraRtcEvents events, RtcServiceOptions options) |
|
native int | fini () |
|
native int | setLogLevel (int level) |
|
native int | configLog (int sizePerFile, int maxFileCount) |
|
native int | notifyNetworkEvent (int event) |
|
native int | createConnection () |
|
native int | destroyConnection (int connId) |
|
native int | getConnectionInfo (int connId, ConnectionInfo connInfo) |
|
native int | joinChannel (int connId, String channelName, int uid, String token, ChannelOptions options) |
|
native int | leaveChannel (int connId) |
|
native int | renewToken (int connId, String token) |
|
native int | muteLocalAudio (int connId, boolean mute) |
|
native int | muteLocalVideo (int connId, boolean mute) |
|
native int | muteRemoteAudio (int connId, int remoteUid, boolean mute) |
|
native int | muteRemoteVideo (int connId, int uid, boolean mute) |
|
native int | requestVideoKeyFrame (int connId, int remoteUid, int streamType) |
|
native int | sendAudioData (int connId, byte[] data, AudioFrameInfo info) |
|
native int | sendVideoData (int connId, byte[] data, VideoFrameInfo info) |
|
native int | setBweParam (int connId, int miniBps, int maxBps, int startBps) |
|
native int | setParams (String params) |
|
native int | setCloudProxy (int type) |
|
native int | loginRtm (String rtmUid, String rtmToken, AgoraRtmEvents events) |
|
native int | logoutRtm () |
|
native int | sendRtm (String rtmUid, int messageId, byte[] message) |
|
◆ configLog()
native int io.agora.rtc.AgoraRtcService.configLog |
( |
int |
sizePerFile, |
|
|
int |
maxFileCount |
|
) |
| |
Configures the log file.
- Parameters
-
sizePerFile | The size (bytes) of each log file. The value range is [0, 10*1024*1024 (10 MB)] and the default value is 1*1024*1024 (1 MB). Set this parameter to 0 to disable logs. |
maxFileCount | The maximum number of log file numbers. The value range is [0, 100] and the default value is 10. Set this parameter to 0 to disable logs. |
- Returns
-
◆ createConnection()
native int io.agora.rtc.AgoraRtcService.createConnection |
( |
| ) |
|
Creates a connection.
- Returns
- Connection ID. A connection can correspond to multiple RTC channels.
◆ destroyConnection()
native int io.agora.rtc.AgoraRtcService.destroyConnection |
( |
int |
connId | ) |
|
Destroys a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
- Returns
-
◆ errToStr()
native String io.agora.rtc.AgoraRtcService.errToStr |
( |
int |
err | ) |
|
Converts an error code to a string.
- Note
- You do not have to release the string after use.
- Parameters
-
- Returns
- The string.
◆ fini()
native int io.agora.rtc.AgoraRtcService.fini |
( |
| ) |
|
Releases all resources allocated to the SDK by init.
- Returns
-
◆ getConnectionInfo()
native int io.agora.rtc.AgoraRtcService.getConnectionInfo |
( |
int |
connId, |
|
|
ConnectionInfo |
connInfo |
|
) |
| |
Gets information about a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. |
connInfo | Connection information. See ConnectionInfo. |
- Returns
-
◆ getVersion()
native String io.agora.rtc.AgoraRtcService.getVersion |
( |
| ) |
|
Gets the SDK version.
- Returns
- The SDK version.
◆ init()
Initializes the SDK.
- Note
- In each process, you can only initialize the SDK once.
- Each time you initialize the SDK, the SDK creates a new folder in your specified log location to save the log files. Agora recommends that you clean the log folder each time you initialize the SDK.
- Parameters
-
appId | Agora App ID. |
events | A set of callbacks that handles SDK events. |
options | Service options. |
- Returns
-
◆ joinChannel()
native int io.agora.rtc.AgoraRtcService.joinChannel |
( |
int |
connId, |
|
|
String |
channelName, |
|
|
int |
uid, |
|
|
String |
token, |
|
|
ChannelOptions |
options |
|
) |
| |
Joins an RTC channel corresponding to a specified connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
channelName | Channel name. The length of a channel name must be less than 64 bytes. Supported character scopes are:
- The 26 lowercase English letters: a to z
- The 26 uppercase English letters: A to Z
- The 10 numbers: 0 to 9
- The space
- "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
|
uid | User ID, which is a 32-bit unsigned integer with a value ranging from 1 to 2^32-1. The uid must be unique. If a uid is set to 0, the SDK assigns and returns a non-zero uid in the on_join_channel_success callback. You must save the returned uid. |
token | RTC Token for authentication.
- If you enable App ID authentication in your Agora project, set this parameter to
NULL .
- If you enable App ID + Token authentication in your Agora project, set this parameter to the RTC token generated on your app server.
|
options | RTC channel options. |
- Returns
-
◆ leaveChannel()
native int io.agora.rtc.AgoraRtcService.leaveChannel |
( |
int |
connId | ) |
|
Leaves an RTC channel corresponding to a specified connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
- Returns
-
◆ licenseGenCredential()
native String io.agora.rtc.AgoraRtcService.licenseGenCredential |
( |
| ) |
|
Generates a credential, which is a unique device identifier.
- Returns
- Credential buffer holding the generated data.
◆ licenseVerify()
native int io.agora.rtc.AgoraRtcService.licenseVerify |
( |
String |
certificate, |
|
|
String |
credential |
|
) |
| |
Authenticates the SDK license.
- Note
- Call this method before calling init.
- Parameters
-
certificate | Certificate buffer. |
credential | Credential buffer. |
- Returns
- = 0: Success.
- < 0: Failure.
◆ loginRtm()
native int io.agora.rtc.AgoraRtcService.loginRtm |
( |
String |
rtmUid, |
|
|
String |
rtmToken, |
|
|
AgoraRtmEvents |
events |
|
) |
| |
Logs into RTM.
- Parameters
-
rtmUid | RTM user ID. Length should be less than 64 bytes. Supported characters include:
- The 26 lowercase English letters: a to z
- The 26 uppercase English letters: A to Z
- The 10 numbers: 0 to 9
- The space
- "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
|
rtmToken | RTM Token for authentication.
- If you enable App ID authentication in your Agora project, set this parameter to
NULL .
- If you enable App ID + Token authentication in your Agora project, set this parameter to the RTM token generated on your app server.
|
events | RTM event handler. |
- Returns
-
◆ logoutRtm()
native int io.agora.rtc.AgoraRtcService.logoutRtm |
( |
| ) |
|
◆ muteLocalAudio()
native int io.agora.rtc.AgoraRtcService.muteLocalAudio |
( |
int |
connId, |
|
|
boolean |
mute |
|
) |
| |
Enables/disables sending local audio data to one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
mute | Enables/disables sending local audio data:
- true: Disable.
- false: Enable.
|
- Returns
-
◆ muteLocalVideo()
native int io.agora.rtc.AgoraRtcService.muteLocalVideo |
( |
int |
connId, |
|
|
boolean |
mute |
|
) |
| |
Enables/disables sending local video data to one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
mute | Enables/disables sending local video data:
- true: Disable.
- false: Enable.
|
- Returns
-
◆ muteRemoteAudio()
native int io.agora.rtc.AgoraRtcService.muteRemoteAudio |
( |
int |
connId, |
|
|
int |
remoteUid, |
|
|
boolean |
mute |
|
) |
| |
Enables/disables receiving remote audio data from one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
remoteUid | Remote user ID. Set this parameter to 0 to specify all remote users. |
mute | Enables/disables receiving remote audio data:
- true: Disable.
- false: Enable.
|
- Returns
-
◆ muteRemoteVideo()
native int io.agora.rtc.AgoraRtcService.muteRemoteVideo |
( |
int |
connId, |
|
|
int |
uid, |
|
|
boolean |
mute |
|
) |
| |
Enables/disables receiving remote video data from one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
uid | Remote user ID. Set this parameter to 0 to specify all remote users. |
mute | Enables/disables receiving remote video data:
- true: Disable.
- false: Enable.
|
- Returns
-
◆ notifyNetworkEvent()
native int io.agora.rtc.AgoraRtcService.notifyNetworkEvent |
( |
int |
event | ) |
|
Sets the network state.
- Parameters
-
- Returns
-
◆ renewToken()
native int io.agora.rtc.AgoraRtcService.renewToken |
( |
int |
connId, |
|
|
String |
token |
|
) |
| |
Renews an RTC token for one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
token | Token for authentication. |
- Returns
-
◆ requestVideoKeyFrame()
native int io.agora.rtc.AgoraRtcService.requestVideoKeyFrame |
( |
int |
connId, |
|
|
int |
remoteUid, |
|
|
int |
streamType |
|
) |
| |
Requests a keyframe from a remote user in one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
remoteUid | Remote user ID. Set this parameter to 0 to specify all remote users. |
streamType | Stream type. |
- Returns
-
◆ sendAudioData()
native int io.agora.rtc.AgoraRtcService.sendAudioData |
( |
int |
connId, |
|
|
byte[] |
data, |
|
|
AudioFrameInfo |
info |
|
) |
| |
Sends an audio frame to one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
data | Audio frame buffer. |
info | Audio frame information. |
- Returns
-
◆ sendRtm()
native int io.agora.rtc.AgoraRtcService.sendRtm |
( |
String |
rtmUid, |
|
|
int |
messageId, |
|
|
byte[] |
message |
|
) |
| |
Sends an RTM message.
- Note
- You must log into RTM and receive the
on_rtm_event
callback before sending RTM message. The call frequency of this method must not exceed 180 within 3 seconds.
- Parameters
-
rtmUid | RTM user ID. |
messageId | Message ID. |
message | Message content. Only supports UTF-8 encoding. |
- Returns
- :
◆ sendVideoData()
native int io.agora.rtc.AgoraRtcService.sendVideoData |
( |
int |
connId, |
|
|
byte[] |
data, |
|
|
VideoFrameInfo |
info |
|
) |
| |
Sends a video frame to one or multiple channels corresponding to a connection.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
data | Audio frame buffer. |
info | Audio frame information. |
- Returns
-
◆ setBweParam()
native int io.agora.rtc.AgoraRtcService.setBweParam |
( |
int |
connId, |
|
|
int |
miniBps, |
|
|
int |
maxBps, |
|
|
int |
startBps |
|
) |
| |
Sets network bandwidth estimation (BWE) parameters.
- Parameters
-
connId | Connection ID. A connection can correspond to multiple RTC channels. Use createConnection to create a connection. Set this parameter to CONNECTION_ID_ALL to specify all current connections. |
miniBps | Minimal bitrate (bps). |
maxBps | Maximum bitrate (bps). |
startBps | Starting bitrate (bps). |
- Returns
- :
◆ setCloudProxy()
native int io.agora.rtc.AgoraRtcService.setCloudProxy |
( |
int |
type | ) |
|
Sets cloud proxy.
- Parameters
-
type | Sets the type of cloud proxy. |
- Returns
- :
◆ setLogLevel()
native int io.agora.rtc.AgoraRtcService.setLogLevel |
( |
int |
level | ) |
|
Sets the log level.
- Parameters
-
- Returns
-
◆ setParams()
native int io.agora.rtc.AgoraRtcService.setParams |
( |
String |
params | ) |
|
Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way.
- Parameters
-
params | Sets the parameter as a JSON string in the specified format. |
- Returns
- :
The documentation for this class was generated from the following file: