From 4bc505f48c82e8c6f3ea26f617865b279e77efbc Mon Sep 17 00:00:00 2001 From: liugang9704 <2745340733@qq.com> Date: Fri, 8 Aug 2025 10:58:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EFAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/pages/VideoMirrorImage.ets | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 CameraKit/entry/src/main/ets/pages/VideoMirrorImage.ets diff --git a/CameraKit/entry/src/main/ets/pages/VideoMirrorImage.ets b/CameraKit/entry/src/main/ets/pages/VideoMirrorImage.ets new file mode 100644 index 00000000..50bccb76 --- /dev/null +++ b/CameraKit/entry/src/main/ets/pages/VideoMirrorImage.ets @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* +* FAQ:如何实现前置镜头的录像镜像功能 +*/ + +// [Start video_mirror_image] +import { camera } from '@kit.CameraKit'; +import { media } from '@kit.MediaKit'; +import { BusinessError } from '@kit.BasicServicesKit'; + +// [StartExclude video_mirror_image] +// [Start is_mirror_supported] +function testIsMirrorSupported(videoOutput: camera.VideoOutput): boolean { + let isSupported: boolean = videoOutput.isMirrorSupported(); + return isSupported; +} + +// [End is_mirror_supported] +// [EndExclude video_mirror_image] + +function enableMirror(videoOutput: camera.VideoOutput, mirrorMode: boolean): void { + try { + videoOutput.enableMirror(mirrorMode); + } catch (error) { + let err = error as BusinessError; + } +} + +// [End video_mirror_image] \ No newline at end of file -- Gitee