You can call the APIs provided by the **Camera** module to develop a distributed camera that provides the basic camera functions such as shooting and video recording.
## How to Develop
Connect your calculator to a distributed device. Your calculator will call **getCameras()** to obtain the camera list and traverse the returned camera list to check **ConnctionType** of the **Camera** objects. If **ConnctionType** of a **Camera** object is **CAMERA_CONNECTION_REMOTE**, your calculator will use this object to create a **CameraInput** object. The subsequent call process is the same as that of the local camera development. For details about the local camera development, see [Camera Development](./camera.md).
For details about the APIs, see [Camera Management](../reference/apis/js-apis-camera.md).
### Connecting to a Distributed Camera
Connect the calculator and the distributed device to the same LAN.
Open the calculator and click the arrow icon in the upper right corner. A new window is displayed. Enter the verification code as prompted, and the calculator will be connected to the distributed device.
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the result. The value **true** means that the camera is muted, and **false** means the opposite.|
| callback | AsyncCallback<boolean\>| Yes | Callback used to return the result. The value **true** means that the camera is muted, and **false** means the opposite.|
**Example**
...
...
@@ -317,9 +317,9 @@ Checks whether this camera is muted. This API uses a promise to return the resul
| callback | AsyncCallback<boolean\>| Yes | Callback used to return the result. The value **true** means that the camera can be muted, and **false** means the opposite.|
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the result. The value **true** means that the camera can be muted, and **false** means the opposite. |
| surfaceId | string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance. |
| surfaceId| string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance.|
**Example**
...
...
@@ -617,16 +617,16 @@ Creates a **PreviewOutput** instance. This API uses a promise to return the resu
| surfaceId | string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
| surfaceId| string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses an asynchronous callback to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the lock.
Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses an asynchronous callback to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the exclusive control.
Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses a promise to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the lock.
Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses a promise to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the exclusive control.
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the flash light support status. The value **true** means that the device has flash light.|
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2108,14 +2108,14 @@ Checks whether a specified flash mode is supported. This API uses a promise to r
| Promise<boolean\> | Promise used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2134,15 +2134,15 @@ Sets the flash mode. This API uses an asynchronous callback to return the result
Before the setting, do the following checks:
1. Use **[hasFlash](#hasflash)** to check whether the device has flash light.
1. Use **[hasFlash](#hasflash)** to check whether the device has flash.
2. Use **[isFlashModeSupported](#isflashmodesupported)** to check whether the device supports the flash mode.
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the exposure mode support status. The value **true** means that the exposure mode is supported, and **false** means the opposite.|
| callback | AsyncCallback<boolean\>| Yes | Callback used to return the exposure mode support status. The value **true** means that the exposure mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2276,14 +2276,14 @@ Checks whether a specified exposure mode is supported. This API uses a promise t
| Promise<boolean\> | Promise used to return the exposure mode support status. The value **true** means that the exposure mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2304,9 +2304,9 @@ Obtains the exposure mode in use. This API uses an asynchronous callback to retu
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2690,14 +2690,14 @@ Checks whether a specified focus mode is supported. This API uses a promise to r
| Promise<boolean\> | Promise used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -2720,9 +2720,9 @@ Before the setting, use **[isFocusModeSupported](#isfocusmodesupported)** to che
| callback | AsyncCallback<boolean\> | Yes | Callback used to return whether the video stabilization mode is supported. The value **true** means that the video stabilization mode is supported, and **false** means the opposite.|
| callback | AsyncCallback<boolean\> | Yes | Callback used to return whether the video stabilization mode is supported. The value **true** means that the video stabilization mode is supported, and **false** means the opposite.|
| Promise<boolean\> | Promise used to return whether the video stabilization mode is supported. The value **true** means that the video stabilization mode is supported, and **false** means the opposite.|
**Example**
...
...
@@ -3180,9 +3180,9 @@ Obtains the video stabilization mode in use. This API uses an asynchronous callb
| callback | AsyncCallback<boolean\>| Yes | Callback used to return the mirroring support status. The value **true** means that mirroring is supported, and **false** means the opposite.|
| callback | AsyncCallback<boolean\> | Yes | Callback used to return the mirroring support status. The value **true** means that mirroring is supported, and **false** means the opposite. |
**Example**
...
...
@@ -3885,9 +3885,9 @@ Checks whether mirroring is supported. This API uses a promise to return the res
| Promise<boolean\> | Promise used to return the mirroring support status. The value **true** means that mirroring is supported, and **false** means the opposite.|
| Promise<boolean\> | Promise used to return the mirroring support status. The value **true** means that mirroring is supported, and **false** means the opposite.|
**Example**
...
...
@@ -3907,10 +3907,10 @@ Listens for shooting start events. This API uses an asynchronous callback to ret