|
Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Instance Methods | |
| (int) | - setMediaRecorderDelegate: |
| (int) | - startRecording: |
| (int) | - stopRecording |
| - (int) setMediaRecorderDelegate: | (id< AgoraMediaRecorderDelegate > _Nullable) | delegate |
Registers the AgoraMediaRecorderDelegate observer.
This method sets the callback for audio and video recording, so that the app can be notified of the recording status and information of the audio and video stream during the recording process. Before calling this method, make sure that:
AgoraRtcEngineKit object.createMediaRecorder:.| delegate | The callback for audio and video stream recording. See AgoraMediaRecorderDelegate for details. |
Error Codes for details and troubleshooting suggestions. | - (int) startRecording: | (AgoraMediaRecorderConfiguration *_Nonnull) | config |
Starts audio and video stream recording.
This method starts recording audio and video streams. The Agora SDK supports recording both local and remote users' audio and video streams simultaneously.
Before starting the recording, make sure that:
createMediaRecorder:.setMediaRecorderDelegate: to listen for recording-related callbacks.This method supports recording the following data:
After recording starts, if the video resolution changes during the recording process, the SDK stops recording. If the audio sample rate or channel count changes, the SDK continues recording and generates a single MP4 recording file.
A recording file is generated only when recordable audio or video streams are detected. If there are no recordable audio or video streams, or if the streams are interrupted for more than 5 seconds during recording, the SDK stops recording and triggers the mediaRecorder:stateDidChanged:uid:state:reason: (AgoraMediaRecorderStateError, AgoraMediaRecorderReasonCodeNoStream) callback.
| config | The configuration for audio and video stream recording. See AgoraMediaRecorderConfiguration for details. |
Error Codes for details and troubleshooting.AgoraRtcEngineKit does not support this operation. This may be due to an ongoing recording or a recording error that caused it to stop.AgoraRtcEngineKit is not initialized when the method is called. Make sure that the AgoraMediaRecorder object is created before calling this method. | - (int) stopRecording |
Stops recording the audio and video stream.
startRecording:, if you want to stop recording, you must call this method; otherwise, the generated recording file may not play properly.AgoraRtcEngineKit is initialized. Make sure you have created the Recorder object before calling this method.