# MediaRecorderConfiguration (/zh-CN/api-reference/rtc/harmonyos/class-mediarecorderconfiguration)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<a id="class_mediarecorderconfiguration__prototype"></a>

```ts
export class MediaRecorderConfiguration {

  public storagePath: string;

  public containerFormat: number = AgoraMediaRecorder.CONTAINER_MP4;

  public streamType: number = AgoraMediaRecorder.STREAM_TYPE_BOTH;

  public maxDurationMs: number = 120000;

  public recorderInfoUpdateInterval: number = 0;
  public constructor(storagePath: string, containerFormat: number, streamType: number,
                     maxDurationMs: number, recorderInfoUpdateInterval: number) {
    this.storagePath = storagePath;
    this.containerFormat = containerFormat;
    this.streamType = streamType;
    this.maxDurationMs = maxDurationMs;
    this.recorderInfoUpdateInterval = recorderInfoUpdateInterval;
  }
}
```

<a id="class_mediarecorderconfiguration__detailed_desc"></a>

<a id="class_mediarecorderconfiguration__parameters"></a>

##

<ParameterList>
<a id="storagepath"></a>
<Parameter name="storagePath">

录制文件在本地保存的绝对路径，需精确到文件名及格式。例如：

:::caution
注意： 请确保你指定的路径存在并且可写。
:::

</Parameter>
<a id="containerformat"></a>
<Parameter name="containerFormat">

录制文件的格式，目前仅支持 CONTAINER_MP4。

</Parameter>
<a id="streamtype"></a>
<Parameter name="streamType">

录制内容：

- STREAM_TYPE_AUDIO：仅音频。
- STREAM_TYPE_VIDEO：仅视频。
- STREAM_TYPE_BOTH：（默认）音视频。

</Parameter>
<a id="maxdurationms"></a>
<Parameter name="maxDurationMs">

最大录制时长，单位为毫秒，默认值为 120000。

</Parameter>
<a id="recorderinfoupdateinterval"></a>
<Parameter name="recorderInfoUpdateInterval">

录制信息更新间隔，单位为毫秒，取值范围为 [1000,10000]。SDK 会根据该值的设置触发 [onRecorderInfoUpdated](/zh-CN/api-reference/rtc/harmonyos/recording#callback_imediarecorderobserver_onrecorderinfoupdated) 回调，报告更新后的录制信息。

</Parameter>
</ParameterList>
