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 app to join the channel.

Parameters
appIdThe App ID used in the communication to be recorded. For details, see Getting an App ID.
channelKeyThis parameter is optional if the user uses a static key, or App ID. In this case, pass NULL as the parameter value. For details, see Use Security Keys.
nameUnique 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
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
uidUser ID. A 32-bit unsigned integer ranging from 1 to (232-1) that is unique in a channel. Two Settings:
  • Set to 0, the system will automatically assign a uid.
  • Set a unique uid (cannot be repeated with any uid in the current channel)
configDetailed recording configuration. See RecordingConfig.
logLevelGenerate the level of the log. After setting up, only logs with a level lower than logLevel will be generated.
Returns
  • 0: Success.
  • < 0: Failure.
Note
  • 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.
  • A channel does not accept duplicate uids. Otherwise, there will be unpredictable behaviors.

◆ 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 mixing 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 to 1 (manually) when joining the channel. For more information, see triggerMode.

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 to 1 (manually) when joining the channel. For more information, see triggerMode.

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 without joining a channel.

Parameters
nativeHandleThe recording engine.
Returns
RecordingEngineProperties. See RecordingEngineProperties.
Note
  • The recording properties only include the path of the recording files.
  • This method is different from onUserJoined. You must call onUserJoined after joining the channel.