diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index 7574cfd3fe90e77176d95914fa610c39bd3561ff..2fe97543f4cc573d623a7740ef118db074151548 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -2486,6 +2486,15 @@ Subscribes to AVRecorder state changes. An application can subscribe to only one | type | string | Yes | Event type, which is **'stateChange'** in this case. This event can be triggered by both user operations and the system.| | callback | function | Yes | Callback invoked when the event is triggered. It reports the following information:
**state**: [AVRecorderState](#avrecorderstate9), indicating the AVRecorder state.
**reason**: [StateChangeReason](#statechangereason9), indicating the reason for the state transition.| +**Error codes** + +For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). + +| ID| Error Message | +| -------- | --------------------------------- | +| 5400103 | IO error. Return by callback. | +| 5400105 | Service died. Return by callback. | + **Example** ```ts @@ -2566,19 +2575,6 @@ Unsubscribes from AVRecorder errors. After the unsubscription, your application | ------ | ------ | ---- | ------------------------------------------------------------ | | type | string | Yes | Event type, which is **'error'** in this case.
This event is triggered when an error occurs during recording.| -**Error codes** - -For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md). - -| ID| Error Message | -| -------- | ------------------------------------------------ | -| 5400101 | No memory. Return by callback. | -| 5400102 | Operation not allowed. Return by callback. | -| 5400103 | I/O error. Return by callback. | -| 5400104 | Time out. Return by callback. | -| 5400105 | Service died. Return by callback. | -| 5400106 | Unsupport format. Return by callback. | - **Example** ```ts @@ -3396,6 +3392,8 @@ Subscribes to video recording error events. After an error event is reported, yo **System capability**: SystemCapability.Multimedia.Media.VideoRecorder +**System API**: This is a system API. + **Parameters** | Name | Type | Mandatory| Description | diff --git a/zh-cn/application-dev/reference/apis/js-apis-media.md b/zh-cn/application-dev/reference/apis/js-apis-media.md index 2b9bb75716707a618004e091694693f2c686d0c9..1fdfacb24c05ea61d68716dde0b8eff6a2622159 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-media.md +++ b/zh-cn/application-dev/reference/apis/js-apis-media.md @@ -2505,6 +2505,15 @@ on(type: 'stateChange', callback: (state: AVRecorderState, reason: StateChangeRe | type | string | 是 | 状态机切换事件回调类型,支持的事件:'stateChange',用户操作和系统都会触发此事件。 | | callback | function | 是 | 状态机切换事件回调方法:
state: [AVRecorderState](#avrecorderstate9),表示当前播放状态 ;
reason: [StateChangeReason](#statechangereason9),表示当前播放状态的切换原因。 | +**错误码:** + +以下错误码的详细介绍请参见[媒体错误码](../errorcodes/errorcode-media.md)。 + +| 错误码ID | 错误信息 | +| -------- | --------------------------------- | +| 5400103 | IO error. Return by callback. | +| 5400105 | Service died. Return by callback. | + **示例:** ```ts @@ -2585,19 +2594,6 @@ off(type: 'error'): void | ------ | ------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 录制错误事件回调类型'error'。
- 'error':录制过程中发生错误,触发该事件。 | -**错误码:** - -以下错误码的详细介绍请参见[媒体错误码](../errorcodes/errorcode-media.md)。 - -| 错误码ID | 错误信息 | -| -------- | ------------------------------------------------ | -| 5400101 | No memory. Return by callback. | -| 5400102 | Operation not allowed. Return by callback. | -| 5400103 | I/O error. Return by callback. | -| 5400104 | Time out. Return by callback. | -| 5400105 | Service died. Return by callback. | -| 5400106 | Unsupport format. Return by callback. | - **示例:** ```ts @@ -3414,6 +3410,8 @@ on(type: 'error', callback: ErrorCallback): void **系统能力:** SystemCapability.Multimedia.Media.VideoRecorder +**系统接口:** 该接口为系统接口 + **参数:** | 参数名 | 类型 | 必填 | 说明 |