@@ -91,7 +91,7 @@ Enable the default system audio effect.
...
@@ -91,7 +91,7 @@ Enable the default system audio effect.
## Obtaining the Global Audio Effect Mode
## Obtaining the Global Audio Effect Mode
You can obtain the global audio effect mode corresponding to a specific audio content type (specified by **ContentType**) and audio stream usage (specified by **StreamUsage**).
You can obtain the global audio effect mode corresponding to a specific audio stream usage (specified by **StreamUsage**).
For an audio playback application, pay attention to the audio effect mode used by the audio stream of the application and perform corresponding operations. For example, for a music application, select the audio effect mode for the music scenario. Before obtaining the global audio effect mode, call **getStreamManager()** to create an **AudioStreamManager** instance.
For an audio playback application, pay attention to the audio effect mode used by the audio stream of the application and perform corresponding operations. For example, for a music application, select the audio effect mode for the music scenario. Before obtaining the global audio effect mode, call **getStreamManager()** to create an **AudioStreamManager** instance.
### Creating an AudioStreamManager Instance
### Creating an AudioStreamManager Instance
...
@@ -107,7 +107,7 @@ Create an **AudioStreamManager** instance. Before using **AudioStreamManager** A
...
@@ -107,7 +107,7 @@ Create an **AudioStreamManager** instance. Before using **AudioStreamManager** A
### Querying the Audio Effect Mode of the Corresponding Scenario
### Querying the Audio Effect Mode of the Corresponding Scenario
| camera | [CameraDevice](#cameradevice) | Yes| Camera object.|
**Return value**
| Type| Description|
| -------- | --------------- |
| boolean | Returns whether the camera supports prelaunch. The value **true** means that the camera supports prelaunch, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [CameraErrorCode](#cameraerrorcode).
| ID | Error Message |
| --------------- | --------------- |
| 7400101 | Parameter missing or parameter type incorrect. |
Creates a deferred **PreviewOutput** instance and adds it to the data stream instead of a common **PreviewOutput** instance during stream configuration.
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **CameraInput** instance is created. This event is triggered and the result is returned when an error occurs on the camera. For example, if the device is unavailable or a conflict occurs, the error information is returned.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **CameraInput** instance is created. This event is triggered and the result is returned when an error occurs on the camera. For example, if the device is unavailable or a conflict occurs, the error information is returned.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a session is created. This event is triggered and the error message is returned when an error occurs during the calling of a session-related API such as **beginConfig()**, **commitConfig()**, and **addInput**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a session is created. This event is triggered and the error message is returned when an error occurs during the calling of a session-related API such as **beginConfig()**, **commitConfig()**, and **addInput**.|
| callback | ErrorCallback\<BusinessError\>| Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback| Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **previewOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the use of a preview-related API such as **start()** or **release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **previewOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the use of a preview-related API such as **start()** or **release()**.|
| callback | ErrorCallback\<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
Adds a surface for delayed preview. This API can run after **session.commitConfig()** is used to commit the configuration for a stream and **session.start()** is used to start the stream.
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **photoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a photographing-related API.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **photoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a photographing-related API.|
| callback | ErrorCallback\<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| boolean | Returns whether the quick thumbnail feature is supported. The value **true** means that the quick thumbnail feature is supported, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [CameraErrorCode](#cameraerrorcode).
| ID | Error Message |
| --------------- | --------------- |
| 7400101 | Parameter missing or parameter type incorrect |
| enabled | boolean | Yes | Whether to enable the quick thumbnail feature. The value **true** means to enable the quick thumbnail feature, and **false** means the opposite.|
**Error codes**
For details about the error codes, see [CameraErrorCode](#cameraerrorcode).
| ID | Error Message |
| --------------- | --------------- |
| 7400101 | Parameter missing or parameter type incorrect |
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **videoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a recording-related API such as **start()** and **release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **videoOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a recording-related API such as **start()** and **release()**.|
| callback | Callback\<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **metadataOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a metadata-related API such as **start()** and **release()**.|
| type | string | Yes | Event type. The value is fixed at **'error'**. The event can be listened for when a **metadataOutput** instance is created. This event is triggered and the corresponding error message is returned when an error occurs during the calling of a metadata-related API such as **start()** and **release()**.|
| callback | Callback\<BusinessError\> | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
| callback | ErrorCallback | Yes | Callback used to return an error code defined in [CameraErrorCode](#cameraerrorcode). |
Selects an audio track. This API can be called only when the AVPlayer is in the prepared state. You can listen for the [trackChange event](#trackchange_on) to determine whether the API calling takes effect.
Deselects an audio track. The default audio track will be used after the audio track is deselected. This API can be called only when the AVPlayer is in the prepared state. You can listen for the [trackChange event](#trackchange_on) to determine whether the API calling takes effect.
Obtains the ID of the current track. This API uses an asynchronous callback to return the result. It can be called only when the AVPlayer is in the prepared, playing, paused, or completed state.
| trackType | [MediaType](#mediatype) | Yes | Enumerates the media types. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the current track. If **-1** is returned, no track for the specified media type exists.|
**Error codes**
For details about the error codes, see [Media Error Codes](../errorcodes/errorcode-media.md).
Obtains the ID of the current track. This API uses a promise to return the result. It can be called only when the AVPlayer is in the prepared, playing, paused, or completed state.
| type | string | Yes | Event type, which is **'trackChange'** in this case.|
**Example**
```js
avPlayer.off('trackChange')
```
## AVPlayerState<sup>9+</sup><a name = avplayerstate></a>
## AVPlayerState<sup>9+</sup><a name = avplayerstate></a>
Enumerates the states of the [AVPlayer](#avplayer9). Your application can proactively obtain the AVPlayer state through the **state** attribute or obtain the reported AVPlayer state by subscribing to the [stateChange](#stateChange_on) event. For details about the rules for state transition, see [Audio Playback](../../media/using-avplayer-for-playback.md).
Enumerates the states of the [AVPlayer](#avplayer9). Your application can proactively obtain the AVPlayer state through the **state** attribute or obtain the reported AVPlayer state by subscribing to the [stateChange](#stateChange_on) event. For details about the rules for state transition, see [Audio Playback](../../media/using-avplayer-for-playback.md).
...
@@ -2680,6 +2518,8 @@ Enumerates the AVRecorder states. You can obtain the state through the **state**
...
@@ -2680,6 +2518,8 @@ Enumerates the AVRecorder states. You can obtain the state through the **state**
Describes the audio and video recording parameters.
Describes the audio and video recording parameters.
The **audioSourceType** and **videoSourceType** parameters are used to distinguish audio-only recording, video-only recording, and audio and video recording. For audio-only recording, set only **audioSourceType**. For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
@@ -2691,8 +2531,6 @@ Describes the audio and video recording parameters.
...
@@ -2691,8 +2531,6 @@ Describes the audio and video recording parameters.
| rotation | number | No | Rotation angle of the recorded video. The value can only be 0 (default), 90, 180, or 270. |
| rotation | number | No | Rotation angle of the recorded video. The value can only be 0 (default), 90, 180, or 270. |
| location | [Location](#location) | No | Geographical location of the recorded video. By default, the geographical location information is not recorded. |
| location | [Location](#location) | No | Geographical location of the recorded video. By default, the geographical location information is not recorded. |
The **audioSourceType** and **videoSourceType** parameters are used to distinguish audio-only recording, video-only recording, and audio and video recording. For audio-only recording, set only **audioSourceType**. For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
## AVRecorderProfile<sup>9+</sup>
## AVRecorderProfile<sup>9+</sup>
Describes the audio and video recording profile.
Describes the audio and video recording profile.
...
@@ -3517,13 +3355,15 @@ Enumerates the video recording states. You can obtain the state through the **st
...
@@ -3517,13 +3355,15 @@ Enumerates the video recording states. You can obtain the state through the **st
Describes the video recording parameters.
Describes the video recording parameters.
The **audioSourceType** and **videoSourceType** parameters are used to distinguish video-only recording from audio and video recording. (For audio-only recording recording, use **[AVRecorder](#avrecorder9)** or **[AudioRecorder](#audiorecorderdeprecated)**.) For video-only recording, set only **videoSourceType**. For audio and video recording, set both **audioSourceType** and **videoSourceType**.
| audioSourceType | [AudioSourceType](#audiosourcetype9) | Yes | Type of the audio source for video recording. |
| audioSourceType | [AudioSourceType](#audiosourcetype9) | No | Type of the audio source for video recording. This parameter is mandatory for audio recording. |
| videoSourceType | [VideoSourceType](#videosourcetype9) | Yes | Type of the video source for video recording. |
| videoSourceType | [VideoSourceType](#videosourcetype9) | Yes | Type of the video source for video recording. |