Classes | |
interface | IMediaRecorderCallback |
class | MediaRecorderConfiguration |
class | RecorderInfo |
Public Member Functions | |
int | startRecording (MediaRecorderConfiguration config) |
int | stopRecording () |
void | release () |
Static Public Member Functions | |
static AgoraMediaRecorder | getMediaRecorder (RtcEngine engine, IMediaRecorderCallback callback) |
Static Public Attributes | |
static final int | RECORDER_STATE_ERROR = -1 |
static final int | RECORDER_STATE_START = 2 |
static final int | RECORDER_STATE_STOP = 3 |
static final int | RECORDER_ERROR_NONE = 0 |
static final int | RECORDER_ERROR_WRITE_FAILED = 1 |
static final int | RECORDER_ERROR_NO_STREAM = 2 |
static final int | RECORDER_ERROR_OVER_MAX_DURATION = 3 |
static final int | RECORDER_ERROR_CONFIG_CHANGED = 4 |
static final int | RECORDER_ERROR_CUSTOM_STREAM_DETECTED = 5 |
static final int | STREAM_TYPE_AUDIO = 0x1 |
static final int | STREAM_TYPE_VIDEO = 0x2 |
static final int | STREAM_TYPE_BOTH = STREAM_TYPE_AUDIO | STREAM_TYPE_VIDEO |
static final int | CONTAINER_MP4 = 1 |
The AgoraMediaRecorder
class, for recording the audio and video on the client. AgoraMediaRecorder
can record the following content:
COMMUNICATION
channel profile, this function is unavailable when there are users using versions of the SDK earlier than v3.0.0 in the channel.
|
static |
Gets the AgoraMediaRecorder
object.
RtcEngine
object.engine | The RtcEngine object. See RtcEngine . |
callback | The IMediaRecorderCallback instance. See IMediaRecorderCallback . |
AgoraMediaRecorder
object. int io.agora.rtc.AgoraMediaRecorder.startRecording | ( | MediaRecorderConfiguration | config | ) |
Starts recording the local audio and video.
After successfully getting the AgoraMediaRecorder
object, you can call this method to enable the recording of the local audio and video.
This method can record the following content:
The SDK can generate a recording file only when it detects the recordable audio and video streams; when there are no audio and video streams to be recorded or the audio and video streams are interrupted for more than five seconds, the SDK stops recording and triggers the onRecorderStateChanged(RECORDER_STATE_ERROR, RECORDER_ERROR_NO_STREAM)
callback.
config | The recording configurations. See MediaRecorderConfiguration . |
ERR_INVALID_ARGUMENT
): The parameter is invalid. Ensure the following:ERR_NOT_SUPPORTED
): RtcEngine
does not support the request due to one of the following reasons:ERR_NOT_INITIALIZED
): The SDK is not initialized before calling this method. Ensure that you have called getMediaRecorder
before calling startRecording
. int io.agora.rtc.AgoraMediaRecorder.stopRecording | ( | ) |
Stops recording the local audio and video.
startRecording
, if you want to stop the recording, you must call stopRecording
; otherwise, the generated recording files might not be playable.ERR_NOT_INITIALIZED
): The SDK is not initialized before calling this method. Ensure that you have called getMediaRecorder
before calling startRecording
. void io.agora.rtc.AgoraMediaRecorder.release | ( | ) |
Releases the AgoraMediaRecorder
object.
This method releases the RtcEngine
object and all other resources used by the AgoraMediaRecorder
object. After calling this method, if you want to enable the recording again, you must call getMediaRecorder
to get the AgoraMediaRecorder
object.
|
static |
-1: An error occurs during the recording. See error
message for the reason.
|
static |
2: The audio and video recording is started.
|
static |
3: The audio and video recording is stopped.
|
static |
0: No error occurs.
|
static |
1: The SDK fails to write the recorded data to a file.
|
static |
2: The SDK does not detect audio and video streams to be recorded, or audio and video streams are interrupted for more than five seconds during recording.
|
static |
3: The recording duration exceeds the upper limit.
|
static |
4: The recording configuration changes.
|
static |
5: The SDK detects audio and video streams from users using versions of the SDK earlier than v3.0.0 in the COMMUNICATION
channel profile.
|
static |
1: Record audio only.
|
static |
2: Record video only.
|
static |
3: Record both audio and video.
|
static |
1: MP4 format.