During video recording, audio and video signals are captured, encoded, and saved to files. You can specify parameters such as the encoding format, encapsulation format, and file path for video recording.
For details about the APIs used for video recording, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md).
### Full-Process Scenario
The full video recording process includes creating an instance, setting recording parameters, recording video, pausing, resuming, and stopping recording, and releasing resources.
// pathName indicates the passed recording file name, for example, 01.mp4. The generated file address is /storage/media/100/local/files/Movies/01.mp4.
// To use the media library, declare the following permissions: ohos.permission.MEDIA_LOCATION, ohos.permission.WRITE_MEDIA, and ohos.permission.READ_MEDIA.
// Video recording depends on camera-related interfaces. The following operations can be performed only after the video output start interface is invoked.
// Start video recording.
awaitvideoRecorder.start().then(()=>{
console.info('start success');
},failureCallback).catch(catchCallback);
// Pause video playback before the video output stop interface is invoked.
awaitvideoRecorder.pause().then(()=>{
console.info('pause success');
},failureCallback).catch(catchCallback);
// Resume video playback after the video output start interface is invoked.
awaitvideoRecorder.resume().then(()=>{
console.info('resume success');
},failureCallback).catch(catchCallback);
// Stop video recording after the video output stop interface is invoked.
awaitvideoRecorder.stop().then(()=>{
console.info('stop success');
},failureCallback).catch(catchCallback);
// Reset the recording configuration.
awaitvideoRecorder.reset().then(()=>{
console.info('reset success');
},failureCallback).catch(catchCallback);
// Release the video recording resources and camera object resources.
> The APIs of this module are supported since API version 9. The APIs of API version 9 is of the Canary version and are for trial use only. The API call may be unstable.
Provides the Extension ability for data sharing.
## Modules to Import
```
import DataShareExtensionAbility from '@ohos.application.DataShareExtensionAbility';
| callback | AsyncCallback\<string> | Yes | Callback used to return the normalized URI object if the Data ability supports URI normalization. If the Data ability does not support URI normalization, **null** is returned.|
> The initial APIs of this module are supported since API version 9. The APIs of API version 9 is of the Canary version and are for trial use only. The API call may be unstable.
**StartOptions** is the basic communication component of the system.
## Modules to Import
```
import StartOptions from '@ohos.application.StartOptions';
> The initial APIs of this module are supported since API version 9. The APIs of API version 9 is of the Canary version and are for trial use only. The API call may be unstable.
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);