diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md
index 6a51a41b6fba50c1c4f7a061d313482e1df57ad9..7229bf0f4c6b812c6ec52d26c0d6f289858725e9 100644
--- a/en/application-dev/reference/apis/js-apis-camera.md
+++ b/en/application-dev/reference/apis/js-apis-camera.md
@@ -1,6 +1,6 @@
-# Camera
+# Camera Management
-> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -11,25 +11,22 @@ import camera from '@ohos.multimedia.camera';
## Required Permissions
-```
ohos.permission.CAMERA
-```
-## getCameraManager(context: Context, callback: AsyncCallback): void;
-**System Capabilities:**
+## camera.getCameraManager
-SystemCapability.Multimedia.Camera.Core
+getCameraManager(context: Context, callback: AsyncCallback): void
-**Description**
+Obtains a **CameraManager** instance. This API uses an asynchronous callback to return the result.
-Gets a **CameraManager** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-------------------------------|-----------|-----------------------------------------------------|
-| context | Context | Yes | Application context |
-| callback | AsyncCallback | Yes | Callback used to return the CameraManager instance |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------- | ---- | ---------------------------------- |
+| context | Context | Yes | Application context. |
+| callback | AsyncCallback<[CameraManager](#cameramanager)\> | Yes | Callback used to return the **CameraManager** instance.|
**Example**
@@ -43,116 +40,105 @@ camera.getCameraManager(context, (err, cameraManager) => {
});
```
-## getCameraManager(context: Context): Promise;
-
-**System Capabilities:**
+## camera.getCameraManager
-SystemCapability.Multimedia.Camera.Core
+getCameraManager(context: Context): Promise
-**Description**
+Obtains a **CameraManager** instance. This API uses a promise to return the result.
-Gets a **CameraManager** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|----------------------------|
-| context | Context | Yes | Application context |
+| Name | Type | Mandatory| Description |
+| ------- | ------- | ---- | ------------ |
+| context | Context | Yes | Application context.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|--------------------------------------------------------|
-| Promise | Promise used to return the **CameraManager** instance |
+| Type | Description |
+| ----------------------------------------- | ----------------------------------------- |
+| Promise<[CameraManager](#cameramanager)\> | Promise used to return the **CameraManager** instance.|
**Example**
```
-camera.getCameraManager(context).then((cameraManger) => {
+camera.getCameraManager(context).then((cameraManager) => {
console.log('Promise returned with the CameraManager instance.');
})
```
-## CameraStatus
+## CameraStatus
-Enumerates camera status types.
+Enumerates the camera statuses.
-**System Capabilities:**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-SystemCapability.Multimedia.Camera.Core
+| Name | Default Value| Description |
+| ------------------------- | ------ | ------------ |
+| CAMERA_STATUS_APPEAR | 0 | The camera exists. |
+| CAMERA_STATUS_DISAPPEAR | 1 | The camera does not exist.|
+| CAMERA_STATUS_AVAILABLE | 2 | The camera is ready. |
+| CAMERA_STATUS_UNAVAILABLE | 3 | The camera is not ready.|
-| Name | Default Value | Description |
-|---------------------------|---------------|--------------------|
-| CAMERA_STATUS_APPEAR | 0 | Camera appear |
-| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear |
-| CAMERA_STATUS_AVAILABLE | 2 | Camera available |
-| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable |
-
-## CameraPosition
+## CameraPosition
Enumerates the camera positions.
-**System Capabilities:**
-
-SystemCapability.Multimedia.Camera.Core
+**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Default value | Description |
-|-----------------------------|---------------|-----------------------|
-| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position |
-| CAMERA_POSITION_BACK | 1 | Rear camera |
-| CAMERA_POSITION_FRONT | 2 | Front camera |
+| Name | Default Value| Description |
+| --------------------------- | ------ | ---------------- |
+| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position.|
+| CAMERA_POSITION_BACK | 1 | Rear camera. |
+| CAMERA_POSITION_FRONT | 2 | Front camera. |
-## CameraType
+## CameraType
Enumerates the camera types.
-**System Capabilities:**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-SystemCapability.Multimedia.Camera.Core
+| Name | Default Value| Description |
+| ----------------------- | ------ | ---------------- |
+| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type.|
+| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera. |
+| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera. |
+| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera. |
+| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera. |
-| Name | Default value | Description |
-|-------------------------|---------------|-------------------------|
-| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type |
-| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera |
-| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera |
-| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera |
-| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera |
+## ConnectionType
-## ConnectionType
+Enumerates the camera connection types.
-Enumerates camera connection types.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**System Capabilities:**
+| Name | Default Value| Description |
+| ---------------------------- | ------ | ------------- |
+| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera. |
+| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB.|
+| CAMERA_CONNECTION_REMOTE | 2 | Remote camera. |
-SystemCapability.Multimedia.Camera.Core
-| Name | Default value | Description |
-|------------------------------|---------------|----------------------------|
-| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera |
-| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB |
-| CAMERA_CONNECTION_REMOTE | 2 | Remote camera |
+## CameraManager
-## CameraManager
+Implements camera management. Before calling any API in **CameraManager**, you must use **getCameraManager** to obtain a **CameraManager** instance.
-Implements camera management, including getting supported cameras and creating **CameraInput** instances.
+### getCameras
-### getCameras(callback: AsyncCallback\>): void;
+getCameras(callback: AsyncCallback\>): void
-**System Capabilities:**
+Obtains all cameras supported by the device. This API uses an asynchronous callback to return the array of supported cameras.
-SystemCapability.Multimedia.Camera.Core
-
-**Description**
-
-Gets all cameras supported by the device. This method uses an asynchronous callback to return the array of supported cameras.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|--------------------------------|-----------|---------------------------------------------------------|
-| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------- | ---- | ------------------------------------ |
+| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras.|
**Example**
@@ -166,21 +152,19 @@ cameraManager.getCameras((err, cameras) => {
})
```
-### getCameras(): Promise\>;
+### getCameras
-**System Capabilities:**
+getCameras(): Promise\>
-SystemCapability.Multimedia.Camera.Core
+Obtains all cameras supported by the device. This API uses a promise to return the array of supported cameras.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Gets all cameras supported by the device. This method uses a promise to return the array of supported cameras.
+**Return value**
-**Return values**
-
-| Type | Description |
-|------------------------|--------------------------------------------------------|
-| Promise\> | Promise used to return an array of supported cameras |
+| Type | Description |
+| ----------------------------------- | ----------------------------- |
+| Promise\> | Promise used to return the array of supported cameras.|
**Example**
@@ -191,22 +175,20 @@ cameraManager.getCameras().then((cameraArray) => {
})
```
-### createCameraInput(cameraId: string, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(cameraId: string, callback: AsyncCallback): void
-**Description**
+Creates a **CameraInput** instance with the specified camera ID. This API uses an asynchronous callback to return the instance.
-Creates a **CameraInput** instance with the specified camera ID. This method uses an asynchronous callback to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Default value | Mandatory | Description |
-|----------|------------------------------|-----------|--------------------------------------------------|
-| cameraId | string | Yes | Camera ID used to create the instance |
-| callback | AsyncCallback | Yes | Callback used to return the CameraInput instance |
+| Name | Default Value | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| cameraId | string | Yes | Camera ID used to create the instance. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
@@ -220,27 +202,25 @@ cameraManager.createCameraInput(cameraId, (err, cameraInput) => {
})
```
-### createCameraInput(cameraId: string): Promise;
+### createCameraInput
-**System Capabilities:**
+createCameraInput(cameraId: string): Promise
-SystemCapability.Multimedia.Camera.Core
+Creates a **CameraInput** instance with the specified camera ID. This API uses a promise to return the instance.
-**Description**
-
-Creates a **CameraInput** instance with the specified camera ID. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Default value | Mandatory | Description |
-|----------|-----------------------------|-----------|------------------------------------------|
-| cameraId | string | Yes | Camera ID used to create the instance |
+| Name | Default Value| Mandatory| Description |
+| -------- | ------ | ---- | ------------ |
+| cameraId | string | Yes | Camera ID used to create the instance.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|-------------------------------------------------|
-| Promise | Promise used to return the CameraInput instance |
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
@@ -250,23 +230,21 @@ cameraManager.createCameraInput(cameraId).then((cameraInput) => {
})
```
-### createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void
-**Description**
+Creates a **CameraInput** instance with the specified camera position and camera type. This API uses an asynchronous callback to return the instance.
-Creates a **CameraInput** instance with the specified camera position and camera type. This method uses an asynchronous callback to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-----------------------------|-----------|---------------------------------------------------|
-| position | CameraPosition | Yes | Camera position |
-| type | CameraType | Yes | Camera type |
-| callback | AsyncCallback | Yes | Callback used to return the CameraInput instance |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| type | [CameraType](#cameratype) | Yes | Camera type. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
@@ -280,28 +258,26 @@ cameraManager.createCameraInput(cameraPosition, cameraType, (err, cameraInput) =
})
```
-### createCameraInput(position: CameraPosition, type: CameraType): Promise;
-
-**System Capabilities:**
+### createCameraInput
-SystemCapability.Multimedia.Camera.Core
+createCameraInput(position: CameraPosition, type: CameraType): Promise
-**Description**
+Creates a **CameraInput** instance with the specified camera position and camera type. This API uses a promise to return the instance.
-Creates a **CameraInput** instance with the specified camera position and camera type. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------------|-----------|----------------------------------------|
-| position | CameraPosition | Yes | Camera position |
-| type | CameraType | Yes | Camera type |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------- | ---- | ---------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position.|
+| type | [CameraType](#cameratype) | Yes | Camera type.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|-------------------------------------------------|
-| Promise | Promise used to return the CameraInput instance |
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
@@ -311,22 +287,20 @@ cameraManager.createCameraInput(cameraPosition, cameraType).then((cameraInput) =
})
```
-### on(type: 'cameraStatus', callback: Callback): void;
+### on('cameraStatus')
-**System Capabilities:**
+on(type: 'cameraStatus', callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Listens for camera status changes. This API uses a callback to return the camera status changes.
-**Description**
-
-Listens for camera status changes. This method uses a callback to get camera status changes.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| :------- | :--------------------- | :-------- | :--------------------------------------------------- |
-| type | string | Yes | Camera status event. |
-| callback | Callback | Yes | Callback used to get the camera status change. |
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------------------- | :--- | :--------------------------------------------------- |
+| type | string | Yes | Type of event to listen for. The value is fixed at **cameraStatus**, indicating the camera status change event.|
+| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change. |
**Example**
@@ -337,22 +311,20 @@ cameraManager.on('cameraStatus', (cameraStatusInfo) => {
})
```
-## Camera
-
-when we call *cameraManager.getCameras()* API, then it will return the **Camera** class which will have all camera-related metadata such as *cameraId, cameraPosition, cameraType & connectionType*.
+## Camera
-**System Capabilities:**
+After **[camera.getCameraManager](#cameragetcameramanager)** is called, a camera instance is returned, including camera-related metadata such as **cameraId**, **cameraPosition**, **cameraType**, and **connectionType**.
-SystemCapability.Multimedia.Camera.Core
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Fields**
+| Name | Type | Read only| Description |
+| -------------- | --------------------------------- | ---- | -------------- |
+| cameraId | string | Yes | Camera ID. |
+| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| cameraType | [CameraType](#cameratype) | Yes | Camera type. |
+| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
-| Name | Type | Access | Description |
-|----------------|----------------|----------|------------------------|
-| cameraId | string | readonly | Camera ID |
-| cameraPosition | cameraPosition | readonly | Camera position |
-| cameraType | cameraType | readonly | Camera type |
-| connectionType | connectionType | readonly | Camera connection type |
+**Example**
```
async function getCameraInfo() {
@@ -367,41 +339,37 @@ async function getCameraInfo() {
```
-## CameraStatusInfo
-
-This interface is a CameraManager callback API return. **CameraStatusInfo** will have *Camera* class & *CameraStatus* predefine constants.From *Camera* class, we can have all camera-related metadata & from *CameraStatus* constants, we will have information such as *APPEAR, DISAPPEAR, AVAILABLE & UNAVAILABLE*.
-
-**System Capabilities:**
-
-SystemCapability.Multimedia.Camera.Core
+## CameraStatusInfo
-**Fields**
+Describes the camera status information.
-| Name | Type | Description |
-|----------------|----------------|------------------|
-| camera | Camera | Camera object |
-| status | CameraStatus | Camera status |
+**System capability**: SystemCapability.Multimedia.Camera.Core
+| Name | Type | Description |
+| ------ | ----------------------------- | ---------- |
+| camera | [Camera](#camera) | Camera object.|
+| status | [CameraStatus](#camerastatus) | Camera status.|
-## CameraInput
-Implements a **CameraInput** instance.
+## CameraInput
-### getCameraId(callback: AsyncCallback\): void;
+Implements a **CameraInput** instance. Before calling any API in **CameraInput**, you must create a **CameraInput** instance.
-**System Capabilities:**
+### getCameraId
-SystemCapability.Multimedia.Camera.Core
+getCameraId(callback: AsyncCallback\): void
-**Description**
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses an asynchronous callback to return the camera ID.
-Gets the camera ID based on which this **CameraInput** instance is created. This method uses an asynchronous callback to return the camera ID.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|------------------------|-----------|---------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the camera ID |
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | -------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the camera ID.|
+
+**Example**
```
cameraInput.getCameraId((err, cameraId) => {
@@ -413,21 +381,19 @@ cameraInput.getCameraId((err, cameraId) => {
})
```
-### getCameraId(): Promise;
-
-**System Capabilities:**
+### getCameraId
-SystemCapability.Multimedia.Camera.Core
+getCameraId(): Promise
-**Description**
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses a promise to return the camera ID.
-Gets the camera ID based on which this **CameraInput** instance is created. This method uses a promise to return the camera ID.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|------------------------|--------------------------------------|
-| Promise | Promise used to return the camera ID |
+| Type | Description |
+| ---------------- | ----------------------------- |
+| Promise | Promise used to return the camera ID.|
**Example**
@@ -437,21 +403,20 @@ cameraInput.getCameraId().then((cameraId) => {
})
```
-### hasFlash(callback: AsyncCallback): void;
-**System Capabilities:**
+### hasFlash
-SystemCapability.Multimedia.Camera.Core
+hasFlash(callback: AsyncCallback): void
-**Description**
+Checks whether the device has flash light. This API uses an asynchronous callback to return the result.
-Checks whether the device has flash light. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-------------------------|-----------|----------------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the flash light support status |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | -------------------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the flash light support status. The value **true** means that the device has flash light.|
**Example**
@@ -465,21 +430,19 @@ cameraInput.hasFlash((err, status) => {
})
```
-### hasFlash(): Promise;
+### hasFlash
-**System Capabilities:**
+hasFlash(): Promise
-SystemCapability.Multimedia.Camera.Core
+Checks whether the device has flash light. This API uses a promise to return the result.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Checks whether the device has flash light. This method uses a promise to return the result.
+**Return value**
-**Return values**
-
-| Type | Description |
-|-----------------------|--------------------------------------------------------|
-| Promise | Promise used to return the flash light support status |
+| Type | Description |
+| ----------------- | ------------------------------------------------------- |
+| Promise | Promise used to return the flash light support status. The value **true** means that the device has flash light.|
**Example**
@@ -489,22 +452,20 @@ cameraInput.hasFlash().then((status) => {
})
```
-### isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### isFlashModeSupported
-SystemCapability.Multimedia.Camera.Core
+isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void
-**Description**
+Checks whether a specified flash mode is supported. This API uses an asynchronous callback to return the result.
-Checks whether a specified flash mode is supported. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
-| callback | AsyncCallback | Yes | Callback used to return the device flash support status |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------------------------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the flash mode support status. The value **true** means that the specified flash mode is supported.|
**Example**
@@ -518,27 +479,25 @@ cameraInput.isFlashModeSupported(flashMode, (err, status) => {
})
```
-### isFlashModeSupported(flashMode: FlashMode): Promise;
+### isFlashModeSupported
-**System Capabilities:**
+isFlashModeSupported(flashMode: FlashMode): Promise
-SystemCapability.Multimedia.Camera.Core
+Checks whether a specified flash mode is supported. This API uses a promise to return the result.
-**Description**
-
-Checks whether a specified flash mode is supported. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return flash mode support status. |
+| Type | Description |
+| ----------------- | ------------------------------------------------------------ |
+| Promise | Promise used to return the flash mode support status. The value **true** means that the specified flash mode is supported.|
**Example**
@@ -548,24 +507,25 @@ cameraInput.isFlashModeSupported(flashMode).then((status) => {
})
```
-### setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
+### setFlashMode
-**System Capabilities:**
+setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Sets the flash mode. This API uses an asynchronous callback to return the result.
-**Description**
+Before setting the parameters, do the following checks:
-Sets flash mode. This method uses an asynchronous callback to return the result.
+1. Use [hasFlash](#hasflash) to check whether the device has flash light.
+2. Use [isFlashModeSupported](#isflashmodesupported) to check whether the device supports a specified flash mode.
-Note: Before setting the flash mode, check the support for the flash light (hasFlash method) and flash mode support (isFlashModeSupported method);
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ------------------------ |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -579,29 +539,30 @@ cameraInput.setFlashMode(flashMode, (err) => {
})
```
-### setFlashMode(flashMode: FlashMode): Promise;
+### setFlashMode
-**System Capabilities:**
+setFlashMode(flashMode: FlashMode): Promise
-SystemCapability.Multimedia.Camera.Core
+Sets the flash mode. This API uses a promise to return the result.
-**Description**
+Before setting the parameters, do the following checks:
-Sets flash mode. This method uses a promise to return the result.
+1. Use [hasFlash](#hasflash) to check whether the device has flash light.
+2. Use [isFlashModeSupported](#isflashmodesupported) to check whether the device supports a specified flash mode.
-Note: Before setting the flash mode, check the support for the flash light (hasFlash method) and flash mode support (isFlashModeSupported method);
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| flashMode | FlashMode | Yes | Flash mode |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|-----------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -611,21 +572,19 @@ cameraInput.setFlashMode(flashMode).then(() => {
})
```
-### getFlashMode(callback: AsyncCallback): void;
+### getFlashMode
-**System Capabilities:**
+getFlashMode(callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Obtains the current flash mode. This API uses an asynchronous callback to return the result.
-**Description**
-
-Gets current flash mode. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|---------------------------|-----------|------------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the current flash mode |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------- | ---- | ---------------------------------------- |
+| callback | AsyncCallback<[FlashMode](#flashmode)\> | Yes | Callback used to return the current flash mode.|
**Example**
@@ -639,21 +598,19 @@ cameraInput.getFlashMode((err, flashMode) => {
})
```
-### getFlashMode(): Promise;
-
-**System Capabilities:**
+### getFlashMode
-SystemCapability.Multimedia.Camera.Core
+getFlashMode(): Promise
-**Description**
+Obtains the current flash mode. This API uses a promise to return the result.
-Gets current flash mode. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return the flash mode |
+| Type | Description |
+| --------------------------------- | --------------------------------------- |
+| Promise<[FlashMode](#flashmode)\> | Promise used to return the current flash mode.|
**Example**
@@ -663,22 +620,20 @@ cameraInput.getFlashMode().then((flashMode) => {
})
```
-### isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
+### isFocusModeSupported
-**System Capabilities:**
+isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Checks whether a specified focus mode is supported. This API uses an asynchronous callback to return the result.
-**Description**
-
-Checks whether a specified focus mode is supported. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|----------------------------------------------------|
-| afMode | FocusMode | Yes | Focus mode |
-| callback | AsyncCallback | Yes | Callback used to return the device focus support status |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | -------------------------------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
+| callback | AsyncCallback | Yes | Callback used to return the focus mode support status. The value **true** means that the specified focus mode is supported.|
**Example**
@@ -692,27 +647,25 @@ cameraInput.isFocusModeSupported(afMode, (err, status) => {
})
```
-### isFocusModeSupported(afMode: FocusMode): Promise;
-
-**System Capabilities:**
+### isFocusModeSupported
-SystemCapability.Multimedia.Camera.Core
+isFocusModeSupported(afMode: FocusMode): Promise
-**Description**
+Checks whether a specified focus mode is supported. This API uses a promise to return the result.
-Checks whether a specified focus mode is supported. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|----------------------------------------|-----------|-------------|
-| afMode | FocusMode | Yes | Focus mode |
+| Name | Type | Mandatory| Description |
+| ------ | ----------------------- | ---- | ---------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return the focus mode support status. |
+| Type | Description |
+| ----------------- | ----------------------------------------------------------- |
+| Promise | Promise used to return the flash mode support status. The value **true** means that the specified focus mode is supported.|
**Example**
@@ -722,24 +675,22 @@ cameraInput.isFocusModeSupported(afMode).then((status) => {
})
```
-### setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### setFocusMode
-SystemCapability.Multimedia.Camera.Core
+setFocusMode(afMode: FocusMode, callback: AsyncCallback): void
-**Description**
+Sets the focus mode. This API uses an asynchronous callback to return the result.
-Sets focus mode. This method uses an asynchronous callback to return the result.
+Before setting the focus mode, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
-Note: Before setting the focus mode, check focus mode support (isFocusModeSupported method);
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|------------------------------------|
-| afMode | FocusMode | Yes | Focus mode |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | ------------------------ |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -753,29 +704,27 @@ cameraInput.setFocusMode(afMode, (err) => {
})
```
-### setFocusMode(afMode: FocusMode): Promise;
+### setFocusMode
-**System Capabilities:**
+setFocusMode(afMode: FocusMode): Promise
-SystemCapability.Multimedia.Camera.Core
+Sets the focus mode. This API uses a promise to return the result.
-**Description**
+Before setting the focus mode, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
-Sets focus mode. This method uses a promise to return the result.
-
-Note: Before setting the focus mode, check focus mode support (isFocusModeSupported method);
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|-----------------------------------------|-----------|-------------|
-| afMode | FocusMode | Yes | Focus mode |
+| Name | Type | Mandatory| Description |
+| ------ | ----------------------- | ---- | ---------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|-----------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -785,21 +734,19 @@ cameraInput.setFocusMode(afMode).then(() => {
})
```
-### getFocusMode(callback: AsyncCallback): void;
+### getFocusMode
-**System Capabilities:**
+getFocusMode(callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Obtains the current focus mode. This API uses an asynchronous callback to return the result.
-**Description**
-
-Gets the current focus mode. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|---------------------------|-----------|------------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the current focus mode |
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------- | ---- | -------------------------------------- |
+| callback | AsyncCallback<[FocusMode](#focusmode)\> | Yes | Callback used to return the current focus mode.|
**Example**
@@ -813,21 +760,19 @@ cameraInput.getFocusMode((err, afMode) => {
})
```
-### getFocusMode(): Promise;
-
-**System Capabilities:**
+### getFocusMode
-SystemCapability.Multimedia.Camera.Core
+getFocusMode(): Promise
-**Description**
+Obtains the current focus mode. This API uses a promise to return the result.
-Gets the current focus mode. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return the focus mode |
+| Type | Description |
+| ------------------- | ------------------------------------- |
+| Promise | Promise used to return the current focus mode.|
**Example**
@@ -837,21 +782,19 @@ cameraInput.getFocusMode().then((afMode) => {
})
```
-### getZoomRatioRange\(callback: AsyncCallback\>\): void;
+### getZoomRatioRange
-**System Capabilities:**
+getZoomRatioRange\(callback: AsyncCallback\>\): void
-SystemCapability.Multimedia.Camera.Core
+Obtains the zoom ratio range. This API uses an asynchronous callback to return the result.
-**Description**
-
-Gets the zoom ratios of all zoom values. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|--------------------------------|-----------|-------------------------------------------------|
-| callback | AsyncCallback\> | Yes | Callback used to return the zoom ratio range |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------ | ---- | ------------------------ |
+| callback | AsyncCallback\> | Yes | Callback used to return the zoom ratio range.|
**Example**
@@ -865,21 +808,19 @@ cameraInput.getZoomRatioRange((err, zoomRatioRange) => {
})
```
-### getZoomRatioRange\(\): Promise\>;
-
-**System Capabilities:**
+### getZoomRatioRange
-SystemCapability.Multimedia.Camera.Core
+getZoomRatioRange\(\): Promise\>
-**Description**
+Obtains the zoom ratio range. This API uses a promise to return the result.
-Gets the zoom ratios of all zoom values. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|------------------------|---------------------------------------------|
-| Promise\> | Promise used to return the zoom ratio range |
+| Type | Description |
+| ------------------------ | ------------------------------------------- |
+| Promise\> | Promise used to return the zoom ratio range.|
**Example**
@@ -889,22 +830,20 @@ cameraInput.getZoomRatioRange().then((zoomRatioRange) => {
})
```
-### setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### setZoomRatio
-SystemCapability.Multimedia.Camera.Core
+setZoomRatio(zoomRatio: number, callback: AsyncCallback): void
-**Description**
+Sets a zoom ratio. This API uses an asynchronous callback to return the result.
-Sets a zoom ratio. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|------------------------|-----------|------------------------------------|
-| zoomRatio | number | Yes | Zoom ratio |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| --------- | -------------------- | ---- | ------------------------ |
+| zoomRatio | number | Yes | Zoom ratio to set. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -918,27 +857,25 @@ cameraInput.setZoomRatio(zoomRatio, (err) => {
})
```
-### setZoomRatio(zoomRatio: number): Promise;
-
-**System Capabilities:**
+### setZoomRatio
-SystemCapability.Multimedia.Camera.Core
+setZoomRatio(zoomRatio: number): Promise
-**Description**
+Sets a zoom ratio. This API uses a promise to return the result.
-Sets a zoom ratio. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|----------|-----------|-------------|
-| zoomRatio | number | Yes | zoom ratio |
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ------------ |
+| zoomRatio | number | Yes | Zoom ratio to set.|
-**Return values**
+**Return value**
-| Type | Description |
-|-----------------------|-----------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -948,21 +885,19 @@ cameraInput.setZoomRatio(zoomRatio).then(() => {
})
```
-### getZoomRatio(callback: AsyncCallback): void;
-
-**System Capabilities:**
+### getZoomRatio
-SystemCapability.Multimedia.Camera.Core
+getZoomRatio(callback: AsyncCallback): void
-**Description**
+Obtains the current zoom ratio. This API uses an asynchronous callback to return the result.
-Gets current zoom ratio value. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-----------|---------------------------|-----------|------------------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the current zoom ratio value |
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the current zoom ratio.|
**Example**
@@ -976,21 +911,19 @@ cameraInput.getZoomRatio((err, zoomRatio) => {
})
```
-### getZoomRatio(): Promise;
+### getZoomRatio
-**System Capabilities:**
+getZoomRatio(): Promise
-SystemCapability.Multimedia.Camera.Core
+Obtains the current zoom ratio. This API uses a promise to return the result.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Gets current zoom ratio value. This method uses a promise to return the result.
+**Return value**
-**Return values**
-
-| Type | Description |
-|-----------------------|---------------------------------------------------|
-| Promise | Promise used to return the zoom ratio vaule |
+| Type | Description |
+| ---------------- | --------------------------- |
+| Promise | Promise used to return the current zoom ratio.|
**Example**
@@ -1000,26 +933,24 @@ cameraInput.getZoomRatio().then((zoomRatio) => {
})
```
-### release\(callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### release
-SystemCapability.Multimedia.Camera.Core
+release\(callback: AsyncCallback\): void
-**Description**
+Releases this **CameraInput** instance. This API uses an asynchronous callback to return the result.
-Releases this **CameraInput** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```
-cameraInput.release((err) => {
+camera.release((err) => {
if (err) {
console.error('Failed to release the CameraInput instance ${err.message}');
return;
@@ -1028,21 +959,19 @@ cameraInput.release((err) => {
});
```
-### release(): Promise;
+### release
-**System Capabilities:**
+release(): Promise
-SystemCapability.Multimedia.Camera.Core
+Releases this **CameraInput** instance. This API uses a promise to return the result.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Releases this **CameraInput** instance. This method uses a promise to return the result.
+**Return value**
-**Return values**
-
-| Type | Description |
-|----------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1052,22 +981,20 @@ cameraInput.release().then(() => {
})
```
-### on(type: 'focusStateChange', callback: Callback): void;
+### on('focusStateChange')
-**System Capabilities:**
+on(type: 'focusStateChange', callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Listens for focus state changes. This API uses a callback to return the focus state changes.
-**Description**
-
-Listens for focus state changes. This method uses a callback to get focus state changes.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| :------- | :--------------------- | :-------- | :-----------------------------------------------|
-| type | string | Yes | Name of the event to listen for. |
-| callback | Callback | Yes | Callback used to get the focus state change. |
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------- | :--- | :------------------------------------------------------- |
+| type | string | Yes | Type of event to listen for. The value is fixed at **focusStateChange**, indicating the focus state change event.|
+| callback | AsyncCallback<[FocusState](#focusstate)\> | Yes | Callback used to return the focus state change. |
**Example**
@@ -1077,22 +1004,20 @@ cameraInput.on('focusStateChange', (focusState) => {
})
```
-### on(type: 'error', callback: Callback): void;
-
-**System Capabilities:**
+### on('error')
-SystemCapability.Multimedia.Camera.Core
+on(type: 'error', callback: ErrorCallback): void
-**Description**
+Listens for **CameraInput** errors. This API uses a callback to return the errors.
-Listens for **CameraInput** errors. This method uses a callback to get errors.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| :------- | :--------------------- | :-------- | :-----------------------------------------------|
-| type | string | Yes | Camera input error event. |
-| callback | Callback | Yes | Callback used to get the camera input errors. |
+| Name | Type | Mandatory| Description |
+| :------- | :------------------------------- | :--- | :---------------------------------------------- |
+| type | string | Yes | Type of event to listen for. The value is fixed at **error**, indicating the camera input error event.|
+| callback | ErrorCallback | Yes | Callback used to return the capture input errors. |
**Example**
@@ -1102,57 +1027,64 @@ cameraInput.on('error', (cameraInputError) => {
})
```
-## FlashMode
-Enumerates the flash modes.
+## FlashMode
-**System Capabilities:**
+Enumerates the flash modes.
-SystemCapability.Multimedia.Camera.Core
+**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Default value | Description |
-|------------------------|---------------|------------------------|
-| FLASH_MODE_CLOSE | 0 | Flash mode close |
-| FLASH_MODE_OPEN | 1 | Flash mode open |
-| FLASH_MODE_AUTO | 2 | Flash mode auto |
-| FLASH_MODE_ALWAYS_OPEN | 3 | Flash mode always open |
+| Name | Default Value| Description |
+| ---------------------- | ------ | ------------ |
+| FLASH_MODE_CLOSE | 0 | The flash is off.|
+| FLASH_MODE_OPEN | 1 | The flash is on.|
+| FLASH_MODE_AUTO | 2 | The flash mode is auto, indicating that the flash fires automatically depending on the shooting conditions.|
+| FLASH_MODE_ALWAYS_OPEN | 3 | The flash is steady on.|
-## FocusMode
+## FocusMode
Enumerates the focus modes.
-**System Capabilities:**
+**System capability**: SystemCapability.Multimedia.Camera.Core
+
+| Name | Default Value| Description |
+| -------------------------- | ------ | ------------------ |
+| FOCUS_MODE_MANUAL | 0 | Manual focus. |
+| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Continuous auto focus.|
+| FOCUS_MODE_AUTO | 2 | Auto focus. |
+| FOCUS_MODE_LOCKED | 3 | Locked focus. |
-SystemCapability.Multimedia.Camera.Core
+## FocusState
-| Name | Default value | Description |
-|----------------------------|---------------|----------------------------|
-| FOCUS_MODE_MANUAL | 0 | Focus mode manual |
-| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Focus mode continuous auto |
-| FOCUS_MODE_AUTO | 2 | Focus mode auto |
-| FOCUS_MODE_LOCKED | 3 | Focus mode locked |
+Enumerates the focus states.
-## createCaptureSession\(context: Context, callback: AsyncCallback\): void;
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**System Capabilities:**
+| Name | Default Value| Description |
+| --------------------- | ------ | ------------ |
+| FOCUS_STATE_SCAN | 0 | Scanning. |
+| FOCUS_STATE_FOCUSED | 1 | Focused.|
+| FOCUS_STATE_UNFOCUSED | 2 | Unfocused.|
-SystemCapability.Multimedia.Camera.Core
+## camera.createCaptureSession
-**Description**
+createCaptureSession\(context: Context, callback: AsyncCallback\): void
-Creates a **CaptureSession** instance. This method uses an asynchronous callback to return the instance.
+Creates a **CaptureSession** instance. This API uses an asynchronous callback to return the instance.
+
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|--------------------------------|-----------|-----------------------------------------------------|
-| context | Context | Yes | Application context |
-| callback | AsyncCallback | Yes | Callback used to return the CaptureSession instance |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------- | ---- | -------------------------------------- |
+| context | Context | Yes | Application context. |
+| callback | AsyncCallback<[CaptureSession](#capturesession)\> | Yes | Callback used to return the **CaptureSession** instance.|
**Example**
```
-captureSession.createCaptureSession((context), (err, captureSession) => {
+camera.createCaptureSession((context), (err, captureSession) => {
if (err) {
console.error('Failed to create the CaptureSession instance. ${err.message}');
return;
@@ -1161,55 +1093,51 @@ captureSession.createCaptureSession((context), (err, captureSession) => {
});
```
-## createCaptureSession(context: Context\): Promise;
-
-**System Capabilities:**
+## camera.createCaptureSession
-SystemCapability.Multimedia.Camera.Core
+createCaptureSession(context: Context\): Promise;
-**Description**
+Creates a **CaptureSession** instance. This API uses a promise to return the instance.
-Creates a **CaptureSession** instance. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|-------------------------------|-----------|-----------------------------------------------------|
-| context | Context | Yes | Application context |
+| Name | Type | Mandatory| Description |
+| ------- | ------- | ---- | ------------ |
+| context | Context | Yes | Application context.|
-**Return values**
+**Return value**
-| Type | Description |
-|---------------------------|---------------------------------------------------|
-| Promise | Promise used to return the CaptureSession instance. |
+| Type | Description |
+| ------------------------------------------- | ----------------------------------------- |
+| Promise<[CaptureSession](#capturesession)\> | Promise used to return the **CaptureSession** instance.|
**Example**
```
-captureSession.createCaptureSession(context).then((captureSession) => {
+camera.createCaptureSession(context).then((captureSession) => {
console.log('Promise returned with the CaptureSession instance');
})
```
-## CaptureSession
+## CaptureSession
Implements session capture.
-### beginConfig\(callback: AsyncCallback\): void;
+### beginConfig
-**System Capabilities:**
+beginConfig\(callback: AsyncCallback\): void
-SystemCapability.Multimedia.Camera.Core
+Starts configuration for this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-**Description**
-
-Starts configuration for this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|----------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1223,21 +1151,19 @@ captureSession.beginConfig((err) => {
});
```
-### beginConfig\(\): Promise;
-
-**System Capabilities:**
+### beginConfig
-SystemCapability.Multimedia.Camera.Core
+beginConfig\(\): Promise
-**Description**
+Starts configuration for this **CaptureSession** instance. This API uses a promise to return the result.
-Starts configuration for this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|---------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1248,21 +1174,19 @@ captureSession.beginConfig().then(() => {
})
```
-### commitConfig\(callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### commitConfig
-SystemCapability.Multimedia.Camera.Core
+commitConfig\(callback: AsyncCallback\): void
-**Description**
+Commits the configuration for this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Commits the configuration for this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|---------------------|-----------|----------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1276,21 +1200,19 @@ captureSession.commitConfig((err) => {
});
```
-### commitConfig\(\): Promise;
-
-**System Capabilities:**
+### commitConfig
-SystemCapability.Multimedia.Camera.Core
+commitConfig\(\): Promise
-**Description**
+Commits the configuration for this **CaptureSession** instance. This API uses a promise to return the result.
-Commits the configuration for this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|---------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1300,22 +1222,20 @@ captureSession.commitConfig().then(() => {
})
```
-### addInput\(cameraInput: CameraInput, callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### addInput
-SystemCapability.Multimedia.Camera.Core
+addInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
-**Description**
+Adds a **CameraInput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Add a CameraInput instance to this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-------------|----------------------|-----------|---------------------------------------------|
-| cameraInput | CameraInput | Yes | CameraInput instance to add |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1329,27 +1249,25 @@ captureSession.addInput(cameraInput, (err) => {
});
```
-### addInput\(cameraInput: CameraInput\): Promise;
+### addInput
-**System Capabilities:**
+addInput\(cameraInput: CameraInput\): Promise
-SystemCapability.Multimedia.Camera.Core
+Adds a **CameraInput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
-**Description**
-
-Add a CameraInput instance to this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-------------|---------------------|-----------|-------------------------------|
-| cameraInput | CameraInput | Yes | CameraInput instance to add |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1359,22 +1277,20 @@ captureSession.addInput(cameraInput).then(() => {
})
```
-### addOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
+### addOutput
-**System Capabilities:**
+addOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void
-SystemCapability.Multimedia.Camera.Core
+Adds a **PreviewOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-**Description**
-
-Add a PreviewOutput instance to this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|----------------------|-----------|-------------------------------------|
-| previewOutput | PreviewOutput | Yes | PreviewOutput instance to add |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1388,27 +1304,25 @@ captureSession.addOutput(previewOutput, (err) => {
});
```
-### addOutput\(previewOutput: PreviewOutput\): Promise;
-
-**System Capabilities:**
+### addOutput
-SystemCapability.Multimedia.Camera.Core
+addOutput\(previewOutput: PreviewOutput\): Promise
-**Description**
+Adds a **PreviewOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
-Add a PreviewOutput instance to this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|--------------------------------|
-| previewOutput | PreviewOutput | Yes | PreviewOutput instance to add |
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to add.|
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1418,22 +1332,20 @@ captureSession.addOutput(previewOutput).then(() => {
})
```
-### addOutput\(photoOutput: PhotoOutput, callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### addOutput
-SystemCapability.Multimedia.Camera.Core
+addOutput\(photoOutput: PhotoOutput, callback: AsyncCallback\): void
-**Description**
+Adds a **PhotoOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Add a PhotoOutput instance to this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|-------------------------------------|
-| photoOutput | PhotoOutput | Yes | PhotoOutput instance to add |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1447,27 +1359,25 @@ captureSession.addOutput(photoOutput, (err) => {
});
```
-### addOutput\(photoOutput: PhotoOutput\): Promise;
+### addOutput
-**System Capabilities:**
+addOutput\(photoOutput: PhotoOutput\): Promise
-SystemCapability.Multimedia.Camera.Core
+Adds a **PhotoOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
-**Description**
-
-Add a PhotoOutput instance to this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|--------------------------------|
-| photoOutput | PhotoOutput | Yes | PhotoOutput instance to add |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to add.|
-**Return values**
+**Return value**
| Type | Description |
-|---------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| -------------- | --------------------------- |
+| Promise\ | Promise used to return the result.|
**Example**
@@ -1477,22 +1387,20 @@ captureSession.addOutput(photoOutput).then(() => {
})
```
-### addOutput\(videoOutput: VideoOutput, callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### addOutput
-SystemCapability.Multimedia.Camera.Core
+addOutput\(videoOutput: VideoOutput, callback: AsyncCallback\): void
-**Description**
+Adds a **VideoOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Add a VideoOutput instance to this CaptureSession instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|-------------------------------------|
-| videoOutput | VideoOutput | Yes | VideoOutput instance to add |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1506,27 +1414,25 @@ captureSession.addOutput(videoOutput, (err) => {
});
```
-### addOutput\(videoOutput: VideoOutput\): Promise;
+### addOutput
-**System Capabilities:**
+addOutput\(videoOutput: VideoOutput\): Promise
-SystemCapability.Multimedia.Camera.Core
+Adds a **VideoOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
-**Description**
-
-Add a VideoOutput instance to this CaptureSession instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|--------------------------------|
-| videoOutput | VideoOutput | Yes | VideoOutput instance to add |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to add.|
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise\ | Promise used to return the result.|
**Example**
@@ -1536,22 +1442,20 @@ captureSession.addOutput(videoOutput).then(() => {
})
```
-### removeInput\(cameraInput: CameraInput, callback: AsyncCallback\): void;
+### removeInput
-**System Capabilities:**
+removeInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
-SystemCapability.Multimedia.Camera.Core
+Removes a **CameraInput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-**Description**
-
-Removes a **CameraInput** instance from this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-------------|----------------------|-----------|------------------------------------|
-| cameraInput | CameraInput | Yes | CameraInput instance to remove |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1565,27 +1469,25 @@ captureSession.removeInput(cameraInput, (err) => {
});
```
-### removeInput\(cameraInput: CameraInput\): Promise;
-
-**System Capabilities:**
+### removeInput
-SystemCapability.Multimedia.Camera.Core
+removeInput\(cameraInput: CameraInput\): Promise
-**Description**
+Removes a **CameraInput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
-Removes a **CameraInput** instance from this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|-------------|---------------------|-----------|---------------------------------|
-| cameraInput | CameraInput | Yes | CameraInput instance to remove |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise\ | Promise used to return the result.|
**Example**
@@ -1595,22 +1497,20 @@ captureSession.removeInput(cameraInput).then(() => {
})
```
-### removeOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### removeOutput
-SystemCapability.Multimedia.Camera.Core
+removeOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void
-**Description**
+Removes a **PreviewOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Removes a **PreviewOutput** instance from this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|----------------------|-----------|------------------------------------|
-| previewOutput | PreviewOutput | Yes | PreviewOutput instance to remove |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1624,28 +1524,26 @@ captureSession.removeOutput(previewOutput, (err) => {
});
```
-### removeOutput(previewOutput: PreviewOutput): Promise;
-
-**System Capabilities:**
+### removeOutput
-SystemCapability.Multimedia.Camera.Core
+removeOutput(previewOutput: PreviewOutput): Promise
-**Description**
+Removes a **PreviewOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
-Removes a **PreviewOutput** instance from this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|-----------------------------------|
-| previewOutput | PreviewOutput | Yes | PreviewOutput instance to remove |
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to remove.|
-**Return values**
+**Return value**
-| Type | Description |
-|---------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1656,22 +1554,20 @@ captureSession.removeOutput(previewOutput).then(() => {
})
```
-### removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
-
-**System Capabilities:**
+### removeOutput
-SystemCapability.Multimedia.Camera.Core
+removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void
-**Description**
+Removes a **PhotoOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Removes a **PhotoOutput** instance from this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|----------------------|-----------|------------------------------------|
-| photoOutput | PhotoOutput | Yes | PhotoOutput instance to remove |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1685,28 +1581,26 @@ captureSession.removeOutput(photoOutput, (err) => {
});
```
-### removeOutput(photoOutput: PhotoOutput): Promise;
+### removeOutput
-**System Capabilities:**
+removeOutput(photoOutput: PhotoOutput): Promise
-SystemCapability.Multimedia.Camera.Core
+Removes a **PhotoOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
-**Description**
-
-Removes a **PhotoOutput** instance from this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|---------------------------------|
-| photoOutput | PhotoOutput | Yes | PhotoOutput instance to remove |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to remove.|
-**Return values**
+**Return value**
-| Type | Description |
-|---------------|------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1717,22 +1611,20 @@ captureSession.removeOutput(photoOutput).then(() => {
})
```
-### removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
+### removeOutput
-**System Capabilities:**
+removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void
-SystemCapability.Multimedia.Camera.Core
+Removes a **VideoOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-**Description**
-
-Removes a **VideoOutput** instance from this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|----------------------|-----------|------------------------------------|
-| videoOutput | VideoOutput | Yes | VideoOutput instance to remove |
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
@@ -1746,28 +1638,26 @@ captureSession.removeOutput(videoOutput, (err) => {
});
```
-### removeOutput(videoOutput: VideoOutput): Promise;
-
-**System Capabilities:**
+### removeOutput
-SystemCapability.Multimedia.Camera.Core
+removeOutput(videoOutput: VideoOutput): Promise
-**Description**
+Removes a **VideoOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
-Removes a **VideoOutput** instance from this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|---------------|---------------------|-----------|---------------------------------|
-| videoOutput | VideoOutput | Yes | VideoOutput instance to remove |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to remove.|
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1778,21 +1668,19 @@ captureSession.removeOutput(videoOutput).then(() => {
})
```
-### start\(callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### start
-SystemCapability.Multimedia.Camera.Core
+start\(callback: AsyncCallback\): void
-**Description**
+Starts this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Starts this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|----------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1806,21 +1694,19 @@ captureSession.start((err) => {
});
```
-### start\(\): Promise;
-
-**System Capabilities:**
+### start
-SystemCapability.Multimedia.Camera.Core
+start\(\): Promise
-**Description**
+Starts this **CaptureSession** instance. This API uses a promise to return the result.
-Starts this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1830,22 +1716,20 @@ captureSession.start().then(() => {
})
```
-### stop\(callback: AsyncCallback\): void;
-
-**System Capabilities:**
+### stop
-SystemCapability.Multimedia.Camera.Core
+stop\(callback: AsyncCallback\): void
-**Description**
+Stops this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
-Stops this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1859,21 +1743,19 @@ captureSession.stop((err) => {
});
```
-### stop(): Promise;
+### stop
-**System Capabilities:**
+stop(): Promise
-SystemCapability.Multimedia.Camera.Core
+Stops this **CaptureSession** instance. This API uses a promise to return the result.
-**Description**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-Stops this **CaptureSession** instance. This method uses a promise to return the result.
+**Return value**
-**Return values**
-
-| Type | Description |
-|----------------|-----------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1883,21 +1765,19 @@ captureSession.stop().then(() => {
})
```
-### release\(callback: AsyncCallback\): void;
+### release
-**System Capabilities:**
+release\(callback: AsyncCallback\): void
-SystemCapability.Multimedia.Camera.Core
+Releases this **CaptureSession** instance. This API uses an asynchronous callback to return the instance.
-**Description**
-
-Releases this **CaptureSession** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1911,21 +1791,19 @@ captureSession.release((err) => {
});
```
-### release(): Promise;
-
-**System Capabilities:**
+### release
-SystemCapability.Multimedia.Camera.Core
+release(): Promise
-**Description**
+Releases this **CaptureSession** instance. This API uses a promise to return the result.
-Releases this **CaptureSession** instance. This method uses a promise to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return values**
+**Return value**
-| Type | Description |
-|----------------|---------------------------------------------|
-| Promise | Promise used to return the result |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise | Promise used to return the result.|
**Example**
@@ -1935,22 +1813,20 @@ captureSession.release().then(() => {
})
```
-### on(type: 'error', callback: Callback): void;
-
-**System Capabilities:**
+### on('error')
-SystemCapability.Multimedia.Camera.Core
+on(type: 'error', callback: ErrorCallback): void
-**Description**
+Listens for **CaptureSession** errors. This API uses a callback to return the errors.
-Listens for **CaptureSession** errors. This method uses a callback to get errors.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| :------- | :--------------------- | :-------- | :-----------------------------------------------|
-| type | string | Yes | Capture session error event. |
-| callback | Callback | Yes | Callback used to get the capture session errors. |
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------- | :--- | :-------------------------------------------- |
+| type | string | Yes | Type of event to listen for. The value is fixed at **error**, indicating the capture session error event.|
+| callback | ErrorCallback | Yes | Callback used to return the capture session errors. |
**Example**
@@ -1960,22 +1836,20 @@ captureSession.on('error', (captureSessionError) => {
})
```
-## createPreviewOutput(surfaceId: string, callback: AsyncCallback): void;
-
-**System Capabilities:**
+## camera.createPreviewOutput
-SystemCapability.Multimedia.Camera.Core
+createPreviewOutput(surfaceId: string, callback: AsyncCallback): void
-**Description**
+Creates a **PreviewOutput** instance. This API uses an asynchronous callback to return the instance.
-Creates a **PreviewOutput** instance. This method uses an asynchronous callback to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|------------|-------------------------------|-----------|----------------------------------------------------|
-| surfaceId | string | Yes | Surface ID received from XComponent view |
-| callback | AsyncCallback | Yes | Callback used to return the PreviewOutput instance |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------------------------------- | ---- | ------------------------------------- |
+| surfaceId | string | Yes | Surface ID received from **XComponent**. |
+| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance.|
**Example**
@@ -1987,29 +1861,27 @@ camera.createPreviewOutput((surfaceId), (err, previewOutput) => {
}
console.log('Callback returned with previewOutput instance');
});
-```
-
-## createPreviewOutput(surfaceId: string): Promise;
+```
-**System Capabilities:**
+## camera.createPreviewOutput
-SystemCapability.Multimedia.Camera.Core
+createPreviewOutput(surfaceId: string): Promise\
-**Description**
+Creates a **PreviewOutput** instance. This API uses a promise to return the instance.
-Creates a **PreviewOutput** instance. This method uses a promise to return the instance.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|------------|-----------------|-----------|----------------------------------------------------|
-| surfaceId | string | Yes | Surface ID received from XComponent view |
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ---------------------------------- |
+| surfaceId | string | Yes | Surface ID received from **XComponent**.|
-**Return values**
+**Return value**
-| Type | Description |
-|-------------------------|---------------------------------------------------|
-| Promise | Promise used to return the PreviewOutput instance |
+| Type | Description |
+| ----------------------------------------- | --------------------------- |
+| Promise<[PreviewOutput](#previewoutput)\> | Promise used to return the **PreviewOutput** instance.|
**Example**
@@ -2023,21 +1895,19 @@ camera.createPreviewOutput(surfaceId).then((previewOutput) => {
Implements preview output.
-### release(callback: AsyncCallback): void;
-
-**System Capabilities:**
+### release
-SystemCapability.Multimedia.Camera.Core
+release(callback: AsyncCallback): void
-**Description**
+Releases this **PreviewOutput** instance. This API uses an asynchronous callback to return the result.
-Releases this **PreviewOutput** instance. This method uses an asynchronous callback to return the result.
+**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-|----------|----------------------|-----------|----------------------------------------------|
-| callback | AsyncCallback | Yes | Callback used to return the result |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -2051,21 +1921,19 @@ previewOutput.release((err) => {
});
```
-### release(): Promise;
+### release
-**System Capabilities:**
+release(): Promise