From eec052c47e5c2e66144d74091e25fb204d600d5c Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 21 Oct 2023 21:37:22 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E9=9F=B3=E9=87=8F=E4=BA=AE=E5=BA=A6?= =?UTF-8?q?=E6=BB=91=E5=8A=A8=E6=8E=A7=E5=88=B6=E6=9D=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/view.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 9605daf1..7fe72dd6 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -74,6 +74,7 @@ class _PLVideoPlayerState extends State late int defaultBtmProgressBehavior; late bool enableQuickDouble; late bool enableBackgroundPlay; + late double screenWidth; void onDoubleTapSeekBackward() { _ctr.onDoubleTapSeekBackward(); @@ -116,6 +117,7 @@ class _PLVideoPlayerState extends State @override void initState() { super.initState(); + screenWidth = Get.size.width; animationController = AnimationController( vsync: this, duration: const Duration(milliseconds: 300)); videoController = widget.controller.videoController!; @@ -128,7 +130,6 @@ class _PLVideoPlayerState extends State setting.get(SettingBoxKey.enableQuickDouble, defaultValue: true); enableBackgroundPlay = setting.get(SettingBoxKey.enableBackgroundPlay, defaultValue: false); - Future.microtask(() async { try { FlutterVolumeController.showSystemUI = true; @@ -508,7 +509,11 @@ class _PLVideoPlayerState extends State } if (tapPosition < sectionWidth) { // 左边区域 👈 - final brightness = _ctr.brightnessValue.value - delta / 100.0; + double level = (_.isFullScreen.value + ? Get.size.height + : screenWidth * 9 / 16) * + 3; + final brightness = _ctr.brightnessValue.value - delta / level; final result = brightness.clamp(0.0, 1.0); setBrightness(result); } else if (tapPosition < sectionWidth * 2) { @@ -531,7 +536,11 @@ class _PLVideoPlayerState extends State _distance = dy; } else { // 右边区域 👈 - final volume = _ctr.volumeValue.value - delta / 100.0; + double level = (_.isFullScreen.value + ? Get.size.height + : screenWidth * 9 / 16) * + 3; + final volume = _ctr.volumeValue.value - delta / level; final result = volume.clamp(0.0, 1.0); setVolume(result); }