diff --git a/lib/pages/setting/widgets/model.dart b/lib/pages/setting/widgets/model.dart index 143f2e0a..1713a7f5 100644 --- a/lib/pages/setting/widgets/model.dart +++ b/lib/pages/setting/widgets/model.dart @@ -742,6 +742,13 @@ List get playSettings => [ setKey: SettingBoxKey.enableQuickDouble, defaultVal: true, ), + SettingsModel( + settingsType: SettingsType.sw1tch, + title: '左右侧滑动调节亮度/音量', + leading: Icon(MdiIcons.tuneVerticalVariant), + setKey: SettingBoxKey.enableSlideVolumeBrightness, + defaultVal: true, + ), SettingsModel( settingsType: SettingsType.normal, title: '自动启用字幕', diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 44d4dce7..d3da8e70 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -257,6 +257,7 @@ class PlPlayerController { late final showFSActionItem = GStorage.showFSActionItem; late final enableShrinkVideoSize = GStorage.enableShrinkVideoSize; late final darkVideoPage = GStorage.darkVideoPage; + late final enableSlideVolumeBrightness = GStorage.enableSlideVolumeBrightness; /// 弹幕权重 int danmakuWeight = 0; diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index 2f867c7d..9f480af8 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -747,12 +747,18 @@ class _PLVideoPlayerState extends State final double tapPosition = details.localFocalPoint.dx; final double sectionWidth = totalWidth / 3; if (tapPosition < sectionWidth) { + if (plPlayerController.enableSlideVolumeBrightness.not) { + return; + } // 左边区域 _gestureType = 'left'; } else if (tapPosition < sectionWidth * 2) { // 全屏 _gestureType = 'center'; } else { + if (plPlayerController.enableSlideVolumeBrightness.not) { + return; + } // 右边区域 _gestureType = 'right'; } @@ -1142,12 +1148,18 @@ class _PLVideoPlayerState extends State final double sectionWidth = totalWidth / 3; late String gestureType; if (tapPosition < sectionWidth) { + if (plPlayerController.enableSlideVolumeBrightness.not) { + return; + } // 左边区域 gestureType = 'left'; } else if (tapPosition < sectionWidth * 2) { // 全屏 gestureType = 'center'; } else { + if (plPlayerController.enableSlideVolumeBrightness.not) { + return; + } // 右边区域 gestureType = 'right'; } diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 304baa1a..9f8facb8 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -406,6 +406,9 @@ class GStorage { static bool get darkVideoPage => GStorage.setting.get(SettingBoxKey.darkVideoPage, defaultValue: false); + static bool get enableSlideVolumeBrightness => GStorage.setting + .get(SettingBoxKey.enableSlideVolumeBrightness, defaultValue: true); + static List get dynamicDetailRatio => List.from(setting .get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0])); @@ -665,6 +668,7 @@ class SettingBoxKey { enableShrinkVideoSize = 'enableShrinkVideoSize', showDynActionBar = 'showDynActionBar', darkVideoPage = 'darkVideoPage', + enableSlideVolumeBrightness = 'enableSlideVolumeBrightness', // Sponsor Block enableSponsorBlock = 'enableSponsorBlock',