harmony 鸿蒙Requesting Camera Development Permissions
Requesting Camera Development Permissions
The main process of camera application development includes development preparations, device input management, session management, preview, photo capture, and video recording.
Before developing a camera application, you must request camera-related permissions (as described in the table below) to ensure that the application has the permission to access the camera hardware and other services. Before requesting permissions, ensure that the basic principles for using permissions are met.
- To use the camera for photo capture, request the ohos.permission.CAMERA permission.
- To use the microphone to record audio, request the ohos.permission.MICROPHONE permission.
- To display location information in photos or videos captured, request the ohos.permission.MEDIA_LOCATION permission.
All these permissions must be authorized by users through a dialog box. For details about how to request and verify the permissions, see Requesting User Authorization.
- To read images or videos, you are advised to use the media library Picker to access them.
- To save images or videos, use the security components to save them.
NOTE
When the application needs to clone, back up, or synchronize images and videos in users’ public directory, request the ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO permissions for reading and writing audio files. For details, see Requesting Restricted Permissions.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Basic Camera Animation (ArkTS)
harmony 鸿蒙Practices for Camera Recovery from the Background (ArkTS)
harmony 鸿蒙Deferred Photo Delivery Practices (ArkTS)
harmony 鸿蒙Deferred Photo Delivery (ArkTS)
harmony 鸿蒙Practices for High-Performance Photo Capture (for System Applications Only) (ArkTS)
harmony 鸿蒙High-Performance Photo Capture (for System Applications Only) (ArkTS)
harmony 鸿蒙Depth Data (for System Applications Only) (ArkTS)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦