MediaRecorderConfiguration

Configurations for the local audio and video recording.

struct MediaRecorderConfiguration {
  const char* storagePath;
  MediaRecorderContainerFormat containerFormat;
  MediaRecorderStreamType streamType;
  int maxDurationMs;
  int recorderInfoUpdateInterval;

  MediaRecorderConfiguration() : storagePath(NULL), containerFormat(FORMAT_MP4), streamType(STREAM_TYPE_BOTH), maxDurationMs(120000), recorderInfoUpdateInterval(0) {}
  MediaRecorderConfiguration(const char* path, MediaRecorderContainerFormat format, MediaRecorderStreamType type, int duration, int interval) : storagePath(path), containerFormat(format), streamType(type), maxDurationMs(duration), recorderInfoUpdateInterval(interval) {}
};

Attributes

storagePath
The absolute path (including the filename extensions) of the recording file. For example:
  • Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.mp4
  • iOS: /App Sandbox/Library/Caches/example.mp4
  • macOS: /Library/Logs/example.mp4
  • Android: /storage/emulated/0/Android/data/<package name>/files/example.mp4
Attention: Ensure that the directory for the log files exists and is writable.
containerFormat
The format of the recording file. See MediaRecorderContainerFormat.
streamType
The recording content. See MediaRecorderStreamType.
maxDurationMs
The maximum recording duration, in milliseconds. The default value is 120000.
recorderInfoUpdateInterval
The interval (ms) of updating the recording information. The value range is [1000,10000]. Based on the value you set in this parameter, the SDK triggers the onRecorderInfoUpdated callback to report the updated recording information.