From 7af321f7d69674e21be6794acd1c77786685c144 Mon Sep 17 00:00:00 2001 From: l30052832 Date: Mon, 2 Sep 2024 11:36:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E9=80=82=E9=85=8D=E5=BA=95?= =?UTF-8?q?=E5=B1=82api=E6=8E=A5=E5=8F=A3=E9=A2=84=E8=A7=88=E6=B5=81?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87=E5=8F=98=E6=9B=B4=202=E3=80=81?= =?UTF-8?q?=E9=98=B2=E6=8A=96=E8=AE=BE=E7=BD=AE=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/constants/CameraConstants.ets | 4 ++-- entry/src/main/ets/utils/VideoRecorder.ets | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/constants/CameraConstants.ets b/entry/src/main/ets/constants/CameraConstants.ets index 54ffef9..3b392e8 100644 --- a/entry/src/main/ets/constants/CameraConstants.ets +++ b/entry/src/main/ets/constants/CameraConstants.ets @@ -93,11 +93,11 @@ export class CameraConstants { /** * camera preview size */ - static readonly PREVIEW_WIDTH: number = 2592; + static readonly PREVIEW_WIDTH: number = 2048; /** * camera preview size */ - static readonly PREVIEW_HEIGHT: number = 1944; + static readonly PREVIEW_HEIGHT: number = 1536; /** * photo size */ diff --git a/entry/src/main/ets/utils/VideoRecorder.ets b/entry/src/main/ets/utils/VideoRecorder.ets index 3c31ff3..4179215 100644 --- a/entry/src/main/ets/utils/VideoRecorder.ets +++ b/entry/src/main/ets/utils/VideoRecorder.ets @@ -140,8 +140,10 @@ export async function videoRecording(isStabilization: boolean, cameraPosition: n videoSession.addOutput(previewOutput); videoSession.addOutput(videoOutput); await videoSession.commitConfig(); - videoSession.setVideoStabilizationMode(isStabilization ? camera.VideoStabilizationMode.HIGH : - camera.VideoStabilizationMode.OFF); + if(videoSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.MIDDLE)){ + videoSession.setVideoStabilizationMode(isStabilization ? camera.VideoStabilizationMode.AUTO : + camera.VideoStabilizationMode.OFF); + } await videoSession.start(); // Obtains the variable focal length ratio range supported by the camera. let zoomRatioRange = videoSession.getZoomRatioRange(); -- Gitee From 74ad1015f3e3fa64b50d2656e2b4372ff441deea Mon Sep 17 00:00:00 2001 From: l30052832 Date: Mon, 2 Sep 2024 11:39:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?readme=E4=BF=AE=E6=94=B9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fbdc323..bc80c85 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,8 @@ 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 +2. HarmonyOS系统:HarmonyOS NEXT Developer Beta5及以上。 -3. DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 +3. DevEco Studio版本:DevEco Studio NEXT Developer Beta5及以上。 -4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 +4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta5 SDK及以上。 -- Gitee