继承自 agora_gaming_rtc.IMediaRecorder .
Public 成员函数 | |
delegate void | OnRecorderStateChangedHandler (RecorderState state, RecorderErrorCode error) |
delegate void | OnRecorderInfoUpdatedHandler (RecorderInfo info) |
override int | StartRecording (MediaRecorderConfiguration config) |
override int | StopRecording () |
abstract int | initMediaRecorderObserver () |
用于在客户端录制本地麦克风采集的、编码为 AAC 格式的音频和本地摄像头采集的、编码后的视频。
delegate void agora_gaming_rtc.MediaRecorder.OnRecorderStateChangedHandler | ( | RecorderState | state, |
RecorderErrorCode | error | ||
) |
录制状态发生改变回调。
本地音视频流录制状态发生改变时,SDK 会触发该回调,报告当前的录制状态和引起录制状态改变的原因。
state | 当前的录制状态。详见 RecorderState 。 |
error | 录制状态出错的原因。详见 RecorderErrorCode 。 |
delegate void agora_gaming_rtc.MediaRecorder.OnRecorderInfoUpdatedHandler | ( | RecorderInfo | info | ) |
录制信息更新回调。
成功注册该回调并开启本地音视频流录制后,SDK 会根据你设置的 recorderInfoUpdateInterval
的值周期性触发该回调,报告当前录制文件的文件名、时长和大小。
info | 录制文件信息。详见 RecorderInfo 。 |
override int agora_gaming_rtc.MediaRecorder.StartRecording | ( | MediaRecorderConfiguration | config | ) |
开启本地音视频流录制。
成功获取 IMediaRecorder 对象后,你可以调用该方法开启本地音视频流录制。
该方法录制的是本地麦克风采集的、编码为 AAC 格式的音频或本地摄像头采集的、编码后的视频。只有当检测到可录制的音视频流时,才能成功生成录制文件;当没有可录制的音视频或录制中的音视频流中断超过 5 秒后,SDK 会停止录制, 并触发 OnRecorderStateChangedHandler(RECORDER_STATE_ERROR,RECORDER_ERROR_NO_STREAM)
回调。
config | 音视频流录制配置。详见 MediaRecorderConfiguration 。 |
-2(ERR_INVALID_ARGUMENT)
: 参数无效。请确保:-4(ERR_NOT_SUPPORTED)
: IRtcEngine 当前状态不支持该操作。可能因为录制正在进行中或录制出错停止。-7(ERR_NOT_INITIALIZED)
: IRtcEngine 尚未初始化就调用方法。请确认在调用 StartRecording
前已调用 GetMediaRecorder。 override int agora_gaming_rtc.MediaRecorder.StopRecording | ( | ) |
停止本地音视频流录制。
StopRecording
前已调用 GetMediaRecorder。
|
pure virtual |
注册 MediaRecorder 观测器。