Developer Center
On-premise Recording
API Reference
Agora Recording Java API Reference
Agora Recording Java API Reference
◆ RecordingSDK()
io.agora.recording.RecordingSDK.RecordingSDK |
( |
| ) |
|
Main methods that can be invoked by your app.
◆ registerOberserver()
To register observer to receive Recording event notification.
◆ unRegisterOberserver()
To remove previously registered observer.
◆ createChannel()
native boolean io.agora.recording.RecordingSDK.createChannel |
( |
String |
appId, |
|
|
String |
channelKey, |
|
|
String |
name, |
|
|
int |
uid, |
|
|
RecordingConfig |
config, |
|
|
int |
logLevel |
|
) |
| |
This method creates a channel and enables the recording application to join the channel.
- Parameters
-
appId | Set appId of the recording application the same as that of the Native/Web SDK. For more information, see Getting an App ID. |
channelKey | The dynamic key for authentication. Set channelKey of the recording application the same as that of the Native/Web SDK. If the Native/Web SDK uses a token, channelKey must be set as the token. For more information, see Use Security Keys. In the Recording SDK, requestToken and renewToken are private interfaces. Therefore, ensure that you set expireTimestamp as 0 when generating a token, which means that the privilege, once generated, never expires. |
name | The name of the channel to be recorded. |
uid | The unique identifier of a user. A channel does not accept duplicate uids. Otherwise, there will be unpredictable behaviors.
-
If you set
uid as 0, the SDK randomly assigns a uid and returns it in the onJoinChannelSuccess.
-
If you set your own
uid , it should be a 32-bit unsigned integer ranging from 1 to (232-1).User ID.
|
config | Detailed recording configuration. See RecordingConfig. |
logLevel | Sets the log level. Only logs in the selected level and levels preceding the selected level are generated.
-
1: Fatal.
-
2: Error.
-
3: Warn.
-
4: Notice.
-
5: Info.
-
6: Debug.
|
- Returns
-
0: Success.
-
< 0: Failure.
◆ leaveChannel()
boolean io.agora.recording.RecordingSDK.leaveChannel |
( |
long |
nativeHandle | ) |
|
This method allows the recording application to leave the channel and release the thread resources.
- Parameters
-
nativeHandle | The recording engine. |
- Returns
-
0: Success.
-
< 0: Failure.
◆ nativeLeaveChannel()
native boolean io.agora.recording.RecordingSDK.nativeLeaveChannel |
( |
long |
nativeHandle | ) |
|
◆ setVideoMixingLayout()
int io.agora.recording.RecordingSDK.setVideoMixingLayout |
( |
long |
nativeHandle, |
|
|
VideoMixingLayout |
layout |
|
) |
| |
This method sets the video mixing layout.
- Note
- If you record video in composite recording mode, you must call this method to set the video layout.
- Parameters
-
- Returns
-
0: Success.
-
< 0: Failure.
◆ startService()
int io.agora.recording.RecordingSDK.startService |
( |
long |
nativeHandle | ) |
|
This method manually starts a recording.
The method is only valid when you set triggerMode in RecrordingConfig as 1 (manually) when joining the channel.
- Parameters
-
nativeHandle | The recording engine. |
- Returns
-
0: Success.
-
< 0: Failure.
◆ stopService()
int io.agora.recording.RecordingSDK.stopService |
( |
long |
nativeHandle | ) |
|
This method manually pauses the recording.
The method is only valid when you set triggerMode in RecrordingConfig as 1 (manually) when joining the channel.
- Parameters
-
nativeHandle | The recording engine. |
- Returns
-
0: Success.
-
< 0: Failure.
◆ getProperties()
This method allows you to retrieve the recording properties.
- Note
-
Call this method after joining the channel.
-
The recording properties only include the relative path of the recording files.
-
Both the
getProperties
method and the onUserJoined callback report the relative path of the recorded files and recording log. The difference between these two functions is that the recording SDK only triggers the onUserJoined callback when a remote user joins the channel.
- Parameters
-
nativeHandle | The recording engine. |
- Returns
- RecordingEngineProperties. See RecordingEngineProperties.
◆ setUserBackground()
int io.agora.recording.RecordingSDK.setUserBackground |
( |
long |
nativeHandle, |
|
|
int |
uid, |
|
|
String |
image_path |
|
) |
| |
This method sets the background image of a specified user.
When the user is online but does not send any video stream, the background image is displayed.
- Note
- The background image is not displayed for users using the Agora Web SDK.
- Parameters
-
nativeHandle | The recording engine. |
uid | The UID of the user for whom the background image to be set. |
image_path | The path of the image file. Only supports local images in JPEG format. |
- Returns
-
0: Success.
-
< 0: Failure.
◆ setLogLevel()
void io.agora.recording.RecordingSDK.setLogLevel |
( |
long |
nativeHandle, |
|
|
int |
level |
|
) |
| |
This method sets the log level.
Only logs in the selected level and levels preceding the selected level are generated. The default value of the log level is 5.
- Parameters
-
nativeHandle | The recording engine. |
level | The log level:
-
1: Fatal.
-
2: Error.
-
3: Warn.
-
4: Notice.
-
5: Info.
-
6: Debug.
|
- Returns
-
0: Success.
-
< 0: Failure.