startFileRecording method

Future<int?> startFileRecording({
  1. required RecordingConfig config,
  2. required RecordingType recordingType,
})

@detail api @hiddensdk(audiosdk) @author wangzhanqiang @brief This method records the audio & video data during the call to a local file. @param config Local recording parameter configuration. See RecordingConfig{@link #RecordingConfig} @param recordingType Locally recorded media type, see RecordingType{@link #RecordingType}
Note:Screen stream only supports recording video (RECORD_VIDEO_ONLY);Main stream supports recording all types. @return 0: Normal
-1: Parameter setting exception
-2: The current version of the SDK does not support this feature, please contact technical support staff @note - You must join a room before calling this method. - Tune When you use this method, you get an onRecordingStateUpdate{@link #IRTCEngineEventHandler#onRecordingStateUpdate} callback. - If the recording is normal, the system will notify the recording progress through the onRecordingProgressUpdate{@link #IRTCEngineEventHandler#onRecordingProgressUpdate} callback every second.

Implementation

Future<int?> startFileRecording(
    {required RecordingConfig config,
    required RecordingType recordingType}) async {
  $a() => ($instance as $p_a.RTCEngine).startFileRecording(
      unpackObject<$p_a.RecordingConfig>(config),
      t_RecordingType.code_to_android(recordingType));
  $i() => ($instance as $p_i.ByteRTCEngine).startFileRecording(
      unpackObject<$p_i.ByteRTCRecordingConfig>(config),
      t_RecordingType.code_to_ios(recordingType));

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}