From 38f80dab6793be88575d13fa103b22b357b5586e Mon Sep 17 00:00:00 2001 From: xieyifeng Date: Mon, 15 Sep 2025 11:29:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B8=B8=E9=87=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MediaService/src/main/ets/common/CommonConstants.ets | 4 ++++ VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VideoPlayerSample/MediaService/src/main/ets/common/CommonConstants.ets b/VideoPlayerSample/MediaService/src/main/ets/common/CommonConstants.ets index 4db6d349..eca562f6 100644 --- a/VideoPlayerSample/MediaService/src/main/ets/common/CommonConstants.ets +++ b/VideoPlayerSample/MediaService/src/main/ets/common/CommonConstants.ets @@ -322,4 +322,8 @@ export class CommonConstants { * video aspect */ static readonly ASPECT: number = 16 / 9; + /** + * full screen width + */ + static readonly FULL_SCREEN_WIDTH: number = 820; } \ No newline at end of file diff --git a/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets b/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets index 2da864fe..b89aebb1 100644 --- a/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets +++ b/VideoPlayerSample/entry/src/main/ets/view/AVPlayer.ets @@ -314,7 +314,7 @@ export struct VideoPlayer { .onActionStart(() => { }) .onActionUpdate((event: GestureEvent) => { - if (event.fingerList[0].globalX > (820 / 2)) { + if (event.fingerList[0].globalX > (CommonConstants.FULL_SCREEN_WIDTH / 2)) { // On the right side of the screen relative to the X-axis coordinate in the upper left corner of the application window, adjust the brightness. this.visible = true; let curBrightness: number = this.screenBrightness - this.getUIContext().vp2px(event.offsetY) / this.getUIContext().vp2px(this.screenHeight); -- Gitee