From 095d16dabda16805ff183131303a956dfc3c90ba Mon Sep 17 00:00:00 2001 From: wupingyuan Date: Fri, 7 Nov 2025 11:36:07 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[issues:#ID5FL7]=20=E4=BF=AE=E6=94=B9re?= =?UTF-8?q?act-native-vision-camera=E7=9A=84=E6=8C=87=E5=AF=BC=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/react-native-vision-camera.md | 22 +++++++++++++++++++++- zh-cn/react-native-vision-camera.md | 22 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/en/react-native-vision-camera.md b/en/react-native-vision-camera.md index c21a14e2..916759ac 100644 --- a/en/react-native-vision-camera.md +++ b/en/react-native-vision-camera.md @@ -307,7 +307,20 @@ Open `entry/src/main/module.json5` and add the following code: + ], + "when":"inuse" + } -+ } ++ }, ++ { ++ "name" : "ohos.permission.ACCELEROMETER", ++ }, ++ { ++ "name" : "ohos.permission.GYROSCOPE", ++ "reason": "$string:sensor_reason", ++ "usedScene": { ++ "abilities": [ ++ "EntryAbility" ++ ], ++ "when":"inuse" ++ } ++ } ] ``` @@ -330,6 +343,10 @@ Open `entry/src/main/resources/base/element/string.json` and add the following c + { + "name": "microphone_reason", + "value": "Use microphone" ++ }, ++ { ++ "name": "sensor_reason", ++ "value": "Use sensor" + }, ] } @@ -373,6 +390,9 @@ Open `entry/src/main/resources/base/element/string.json` and add the following c | onStopped | Called when the camera stopped the session (`isActive={false}`) | function | no | All | yes | | onShutter | Called just before a photo or snapshot is captured. | function | no | All | yes | | codeScanner | A CodeScanner that can detect QR-Codes or Barcodes using platform-native APIs | object | no | All | yes | +| videoAspectRatio | Set the aspect ratio of recorded videos to adapt to various device scenarios(16/9、1:1) | number | no | no | yes | +| photoAspectRatio | Set aspect ratio for taking photos to adapt to various device scenarios(4/3、1:1) | number | no | no | yes | +| isMirrored | Set camera mirroring | boolean | no | Android/iOS | yes | ## Static Methods diff --git a/zh-cn/react-native-vision-camera.md b/zh-cn/react-native-vision-camera.md index 60c05c2c..92675c88 100644 --- a/zh-cn/react-native-vision-camera.md +++ b/zh-cn/react-native-vision-camera.md @@ -309,7 +309,20 @@ ohpm install + ], + "when":"inuse" + } -+ } ++ }, ++ { ++ "name" : "ohos.permission.ACCELEROMETER", ++ }, ++ { ++ "name" : "ohos.permission.GYROSCOPE", ++ "reason": "$string:sensor_reason", ++ "usedScene": { ++ "abilities": [ ++ "EntryAbility" ++ ], ++ "when":"inuse" ++ } ++ } ] ``` @@ -333,6 +346,10 @@ ohpm install + "name": "microphone_reason", + "value": "使用麦克风" + }, ++ { ++ "name": "sensor_reason", ++ "value": "使用传感器" ++ } ] } ``` @@ -375,6 +392,9 @@ ohpm install | onStopped | Called when the camera stopped the session (`isActive={false}`) | function | no | All | yes | | onShutter | Called just before a photo or snapshot is captured. | function | no | All | yes | | codeScanner | A CodeScanner that can detect QR-Codes or Barcodes using platform-native APIs | object | no | All | yes | +| videoAspectRatio | Set the aspect ratio of recorded videos to adapt to various device scenarios(16/9、1:1) | number | no | no | yes | +| photoAspectRatio | Set aspect ratio for taking photos to adapt to various device scenarios(4/3、1:1) | number | no | no | yes | +| isMirrored | Set camera mirroring | boolean | no | Android/iOS | yes | ## 静态方法 -- Gitee