#include <IAgoraRecordingEngine.h>
The IRecordingEngine class provides the main methods that can be invoked by your application.
◆ createAgoraRecordingEngine()
This method creates the Agora recording engine object.
- Parameters
-
appId | The App ID used in the communications to be recorded. For more information, see Get an App ID. |
eventHandler | The Agora Recording SDK notifies the application of the triggered events by callbacks in the IRecordingEngineEventHandler. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getProperties()
This method allows you to retrieve the recording properties without joining a channel. For more information, see RecordingEngineProperties.
- Returns
- 0: Success.
- < 0: Failure.
- Note
- The recording properties only include the information of the path where the recording files are stored.
- This method is different from onUserJoined. You must call onUserJoined after joining the channel.
◆ joinChannel()
virtual int agora::recording::IRecordingEngine::joinChannel |
( |
const char * |
channelKey, |
|
|
const char * |
channelId, |
|
|
uid_t |
uid, |
|
|
const RecordingConfig & |
config |
|
) |
| |
|
pure virtual |
This method allows the recording application to join a channel and start recording.
- Parameters
-
channelKey | This parameter is optional if the user uses a static key, or App ID. In this case, pass NULL as the parameter value. For more information, see Use Security Keys. |
channelId | Name of the channel to be recorded. The length must be within 64 bytes. The following is the supported scope:
- 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
- "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
|
uid | UID. A 32-bit unsigned integer ranging from 1 to (232-1) that is unique in a channel. |
config | Detailed recording configuration. See the structure RecordingConfig. |
- Returns
- 0: Success.
- < 0: Failure.
- Note
- In the Recording SDK, requestToken and renewToken are private methods. 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()
virtual int agora::recording::IRecordingEngine::leaveChannel |
( |
| ) |
|
|
pure virtual |
This method allows the recording application to leave the channel and release the thread resources.
- Returns
- 0: Success.
- < 0: Failure.
◆ release()
virtual int agora::recording::IRecordingEngine::release |
( |
| ) |
|
|
pure virtual |
This method destroys the IRecordingEngine object.
- Returns
- 0: Success.
- < 0: Failure.
◆ setLogLevel()
virtual int agora::recording::IRecordingEngine::setLogLevel |
( |
agora::linuxsdk::agora_log_level |
level | ) |
|
|
pure virtual |
This method sets the log level.
Only log levels preceding the selected level are generated. The default value of the log level is 6.
- Parameters
-
level | See agora_log_level. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setUserBackground()
virtual int agora::recording::IRecordingEngine::setUserBackground |
( |
uid_t |
uid, |
|
|
const char * |
img_path |
|
) |
| |
|
pure virtual |
This method sets the background image of a specified user. When the user is online but not sending out any video stream, the background image is displayed.
- Note
- If the user uses Agora Web SDK, the user sends the audio and video stream all the time. In this case, the background image is not displayed.
- Parameters
-
uid | The UID of the user for the background image to be set. |
img_path | The path of the image file. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setVideoMixingLayout()
This method sets the video mixing layout.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ startService()
virtual int agora::recording::IRecordingEngine::startService |
( |
| ) |
|
|
pure virtual |
This method manually starts recording.
The method is only valid when you set triggerMode to 1 (manually) when joining the channel. For more information, see TRIGGER_MODE_TYPE.
- Returns
- 0: Success.
- < 0: Failure.
◆ stoppedOnError()
virtual int agora::recording::IRecordingEngine::stoppedOnError |
( |
| ) |
|
|
pure virtual |
This method stops onError handler. It is called in onError handler when meeting an error which cannot be handled.
- Returns
- 0: Success.
- < 0: Failure.
◆ stopService()
virtual int agora::recording::IRecordingEngine::stopService |
( |
| ) |
|
|
pure virtual |
This method manually stops recording.
The method is only valid when you set triggerMode to 1 (manually) when joining the channel. For more information, see TRIGGER_MODE_TYPE.
- Returns
- 0: Success.
- < 0: Failure.
The documentation for this class was generated from the following file: