@@ -16,21 +16,20 @@ During video recording, audio and video signals are captured, encoded, and saved
...
@@ -16,21 +16,20 @@ During video recording, audio and video signals are captured, encoded, and saved
## How to Develop
## How to Develop
For details about the APIs used for video recording, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md).
For details about the APIs, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md).
### Full-Process Scenario
### 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.
The full video recording process includes creating an instance, setting recording parameters, starting, pausing, resuming, and stopping recording, and releasing resources.
privatetestFdNumber;// Used to save the FD address.
// pathName indicates the passed recording file name, for example, 01.mp4. The generated file address is /storage/media/100/local/files/Video/01.mp4.
// 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.
// To use the media library, declare the following permissions: ohos.permission.MEDIA_LOCATION, ohos.permission.WRITE_MEDIA, and ohos.permission.READ_MEDIA.
asyncgetFd(pathName){
asyncfunctiongetFd(pathName){
letdisplayName=pathName;
letdisplayName=pathName;
constmediaTest=mediaLibrary.getMediaLibrary();
constmediaTest=mediaLibrary.getMediaLibrary();
letfileKeyObj=mediaLibrary.FileKey;
letfileKeyObj=mediaLibrary.FileKey;
...
@@ -38,110 +37,115 @@ async function getFd(pathName) {
...
@@ -38,110 +37,115 @@ async function getFd(pathName) {
// Obtain the surface ID, save it, and pass it to camera-related APIs.
// Video recording depends on camera-related interfaces. The following operations can be performed only after the video output start interface is invoked.
// Video recording depends on camera-related APIs. The following operations can be performed only after the video output start API is invoked. For details about how to call the camera APIs, see the samples.
// Start video recording.
// Pause video playback before the video output stop interface is invoked.