Video SDK v3.7.1 API Reference for Unity
|
Inherits agora_gaming_rtc.IMediaRecorder.
Public Member Functions | |
delegate void | OnRecorderStateChangedHandler (RecorderState state, RecorderErrorCode error) |
delegate void | OnRecorderInfoUpdatedHandler (RecorderInfo info) |
override int | StartRecording (MediaRecorderConfiguration config) |
override int | StopRecording () |
override void | InitMediaRecorderObserver () |
The MediaRecorder class, for recording the audio and video on the client. IMediaRecorder can record the following content:
Since v3.6.1.1
COMMUNICATION
channel profile, this function is unavailable when there are users using versions of the SDK earlier than v3.0.1 in the channel. delegate void agora_gaming_rtc.MediaRecorder.OnRecorderStateChangedHandler | ( | RecorderState | state, |
RecorderErrorCode | error | ||
) |
Occurs when the recording state changes.
When the local audio and video recording state changes, the SDK triggers this callback to report the current recording state and the reason for the change.
state | The current recording state. See RecorderState. |
error | The reason for the state change. See RecorderErrorCode. |
delegate void agora_gaming_rtc.MediaRecorder.OnRecorderInfoUpdatedHandler | ( | RecorderInfo | info | ) |
Occurs when the recording information is updated.
After you successfully register this callback and enable the local audio and video recording, the SDK periodically triggers the OnRecorderInfoUpdatedHandler callback based on the set value of recorderInfoUpdateInterval
. This callback reports the filename, duration, and size of the current recording file.
info | Information for the recording file. See RecorderInfo. |
|
static |
|
virtual |
Starts recording the local audio and video.
After successfully getting the 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 OnRecorderStateChangedHandler(RECORDER_STATE_ERROR, RECORDER_ERROR_NO_STREAM)
callback.
config | The recording configurations. See MediaRecorderConfiguration. |
-2(ERR_INVALID_ARGUMENT)
: The parameter is invalid. Ensure the following:-4(ERR_NOT_SUPPORTED)
: IRtcEngine does not support the request due to one of the following reasons:-7(ERR_NOT_INITIALIZED)
: This method is called before the initialization of IRtcEngine. Ensure that you have called GetMediaRecorder
before calling StartRecording
. Implements agora_gaming_rtc.IMediaRecorder.
|
virtual |
Stops recording the local audio and video.
StartRecording
.Implements agora_gaming_rtc.IMediaRecorder.
|
virtual |
Initializes the media recorder observer object.
Implements agora_gaming_rtc.IMediaRecorder.
OnRecorderStateChangedHandler agora_gaming_rtc.MediaRecorder._OnRecorderStateChanged |
OnRecorderInfoUpdatedHandler agora_gaming_rtc.MediaRecorder._OnRecorderInfoUpdated |