Subscribes to audio interrupt events. This API uses a callback to get interrupt events. The interrupt event is triggered when audio rendering is interrupted.
> 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.
Creates a **CameraInput** instance with the specified camera position and camera type. This method uses an asynchronous callback to return the instance.
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*.
| cameraPosition | cameraPosition | readonly | Camera position |
| cameraType | cameraType | readonly | Camera type |
| connectionType | connectionType | readonly | Camera connection type |
```
asyncfunctiongetCameraInfo(){
varcameraManager=awaitcamera.getCameraManager();
varcameras=awaitcameraManager.getCameras();
varcameraObj=cameras[0];
varcameraId=cameraObj.cameraId;
varcameraPosition=cameraObj.cameraPosition;
varcameraType=cameraObj.cameraType;
varcameraId=cameraObj.connectionType;
}
```
## CameraStatusInfo<a name="section_Camera"></a>
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*.
Sets flash mode. This method uses an asynchronous callback to return the result.
Note: Before setting the flash mode, check the support for the flash light (<ahref="#sec_hasFlash">hasFlash</a> method) and flash mode support (<ahref="#sec_isFlashModeSupported">isFlashModeSupported</a> method);
Sets flash mode. This method uses a promise to return the result.
Note: Before setting the flash mode, check the support for the flash light (<ahref="#sec_hasFlash">hasFlash</a> method) and flash mode support (<ahref="#sec_isFlashModeSupported">isFlashModeSupported</a> method);
@@ -1836,662 +1769,6 @@ Enumerates the audio output formats.
| AMR_WB | 4 | AMR_WB.<br>This API is merely defined in OpenHarmony 3.1 Release and cannot be used currently. It can be used in OpenHarmony 3.1 MR.|
| AAC_ADTS | 6 | Audio Data Transport Stream (ADTS), which is a transport stream format of AAC-based audio.|
## VideoRecorder<sup>9+</sup>
Implements video recording. Before calling an API of the **VideoRecorder** class, you must call [createVideoRecorder()](#mediacreatevideorecorder9) to create a [VideoRecorder](#videorecorder9) instance.
For details about the video recording demo, see [Video Recording Development](../../media/video-recorder.md).
Obtains the surface required for recording in asynchronous mode. This surface is provided for the caller. The caller obtains the **surfaceBuffer** from this surface and fills in the corresponding data.
Note that the video data must carry the timestamp (in ns) and buffer size, and the start time of the timestamp is based on the system startup time.
This API can be called only after [prepare()](#videorecorder_prepare1) is called.
| callback | AsyncCallback\<string> | Yes | Callback used to obtain the result.|
**Example**
```js
// asyncallback
letsurfaceID=null;// Surface ID passed to the external system.
videoRecorder.getInputSurface((err,surfaceId)=>{
if(typeof(err)=='undefined'){
console.info('getInputSurface success');
surfaceID=surfaceId;
}else{
console.info('getInputSurface failed and error is '+err.message);
}
});
```
### getInputSurface<sup>9+</sup>
getInputSurface(): Promise\<string>;
Obtains the surface required for recording in asynchronous mode. This surface is provided for the caller. The caller obtains the **surfaceBuffer** from this surface and fills in the corresponding data.
Note that the video data must carry the timestamp (in ns) and buffer size, and the start time of the timestamp is based on the system startup time.
This API can be called only after [prepare()](#videorecorder_prepare1) is called.
Starts video recording in asynchronous mode. This API uses a callback to return the result.
This API can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first.
Starts video recording in asynchronous mode. This API uses a promise to return the result.
This API can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first.
| type | string | Yes | Type of the event to subscribe to, which is 'error' in this API.<br>The 'error' event is triggered when an error occurs during video recording.|
| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. |
**Example**
```js
videoRecorder.on('error',(error)=>{// Set the 'error' event callback.
console.info(`audio error called, errName is ${error.name}`);// Print the error name.
console.info(`audio error called, errCode is ${error.code}`);// Print the error code.
console.info(`audio error called, errMessage is ${error.message}`);// Print the detailed description of the error type.
});
// This event is reported when an error occurs during the retrieval of videoRecordState.
```
## VideoRecordState<sup>9+</sup>
Enumerates the video recording states. You can obtain the state through the **state** attribute.
| rotation | number | No | Rotation angle of the recorded video. |
| location | [Location](#location) | No | Geographical location of the recorded video. |
| url | string | Yes | Video output URL. Supported: fd://xx (fd number)<br>![](figures/en-us_image_url.png)<br>The file must be created by the caller and granted with proper permissions.|
## AudioSourceType<sup>9+</sup>
Enumerates the audio source types for video recording.