Public Member Functions

 RecordingSDK ()
 
void registerOberserver (RecordingEventHandler recordingEventHandler)
 
void unRegisterOberserver (RecordingEventHandler recordingEventHandler)
 
native boolean createChannel (String appId, String channelKey, String name, int uid, RecordingConfig config, int logLevel)
 
native boolean leaveChannel (long nativeHandle)
 
native int setVideoMixingLayout (long nativeHandle, VideoMixingLayout layout)
 
native int startService (long nativeHandle)
 
native int stopService (long nativeHandle)
 
native RecordingEngineProperties getProperties (long nativeHandle)
 

Constructor & Destructor Documentation

◆ RecordingSDK()

io.agora.recording.RecordingSDK.RecordingSDK ( )

Main methods that can be invoked by your app.

Member Function Documentation

◆ registerOberserver()

void io.agora.recording.RecordingSDK.registerOberserver ( RecordingEventHandler  recordingEventHandler)

To register observer to receive Recording event notification.

◆ unRegisterOberserver()

void io.agora.recording.RecordingSDK.unRegisterOberserver ( RecordingEventHandler  recordingEventHandler)

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
appIdSet appId of the recording application the same as that of the Native/Web SDK. A channel does not accept duplicate uids. Otherwise, there will be unpredictable behaviors. For more information, see Getting an App ID.
channelKeyThe channelKey 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. Make sure that you set expireTimestamp as 0 when generating a token, which means that the privilege, once generated, never expires.
nameThe unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are:
  • The 26 lowercase English letters from a to z
  • The 26 uppercase English letters from A to Z
  • The 10 numbers from 0 to 9
  • The space
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
uidThe unique identifier of a user.
  • 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.
configDetailed recording configuration. See RecordingConfig.
logLevelSets the log level. Only logs in the levels preceding the selected level are generated.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannel()

native boolean io.agora.recording.RecordingSDK.leaveChannel ( long  nativeHandle)

This method allows the recording app to leave the channel and release the thread resources.

Parameters
nativeHandleThe recording engine.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoMixingLayout()

native int io.agora.recording.RecordingSDK.setVideoMixingLayout ( long  nativeHandle,
VideoMixingLayout  layout 
)

This method sets the video layout in composite recording mode.

Note
If you record video in composite recording mode, you must call this method to set the video layout.
Parameters
nativeHandleThe recording engine.
layoutLayout setting. See VideoMixingLayout.
Returns
  • 0: Success.
  • < 0: Failure.

◆ startService()

native int io.agora.recording.RecordingSDK.startService ( long  nativeHandle)

This method manually starts a recording.

The method is only valid when you set triggerMode in RecordingConfig as 1 (manually) when joining the channel.

Parameters
nativeHandleThe recording engine.
Returns
  • 0: Success.
  • < 0: Failure.

◆ stopService()

native int io.agora.recording.RecordingSDK.stopService ( long  nativeHandle)

This method manually pauses the recording.

The method is only valid when you set triggerMode in RecordingConfig as 1 (manually) when joining the channel.

Parameters
nativeHandleThe recording engine.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getProperties()

native RecordingEngineProperties io.agora.recording.RecordingSDK.getProperties ( long  nativeHandle)

This method allows you to retrieve the recording properties.

Note
  • Call this method after joining the channel.
  • The recording properties only include the path of the recording files.
  • This method is different from onUserJoined. The onUserJoined callback is only triggered when a remote user joins the channel.
Parameters
nativeHandleThe recording engine.
Returns
RecordingEngineProperties. See RecordingEngineProperties.