mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: custom slide fs
Closes #585 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -752,6 +752,13 @@ List<SettingsModel> get playSettings => [
|
||||
setKey: SettingBoxKey.enableSlideVolumeBrightness,
|
||||
defaultVal: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '中间滑动进入/退出全屏',
|
||||
leading: Icon(MdiIcons.panVertical),
|
||||
setKey: SettingBoxKey.enableSlideFS,
|
||||
defaultVal: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.normal,
|
||||
title: '自动启用字幕',
|
||||
|
||||
@@ -255,6 +255,7 @@ class PlPlayerController {
|
||||
late final enableShrinkVideoSize = GStorage.enableShrinkVideoSize;
|
||||
late final darkVideoPage = GStorage.darkVideoPage;
|
||||
late final enableSlideVolumeBrightness = GStorage.enableSlideVolumeBrightness;
|
||||
late final enableSlideFS = GStorage.enableSlideFS;
|
||||
|
||||
/// 弹幕权重
|
||||
int danmakuWeight = 0;
|
||||
|
||||
@@ -767,6 +767,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
/// 锁定时禁用
|
||||
if (plPlayerController.controlsLock.value) return;
|
||||
if (plPlayerController.enableSlideVolumeBrightness.not &&
|
||||
plPlayerController.enableSlideFS.not) {
|
||||
return;
|
||||
}
|
||||
|
||||
RenderBox renderBox =
|
||||
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
||||
|
||||
@@ -788,6 +793,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
// 左边区域
|
||||
_gestureType = 'left';
|
||||
} else if (tapPosition < sectionWidth * 2) {
|
||||
if (plPlayerController.enableSlideFS.not) {
|
||||
return;
|
||||
}
|
||||
// 全屏
|
||||
_gestureType = 'center';
|
||||
} else {
|
||||
@@ -1160,6 +1168,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
},
|
||||
onVerticalDragUpdate: (details) {
|
||||
if (plPlayerController.controlsLock.value) return;
|
||||
if (plPlayerController.enableSlideVolumeBrightness.not &&
|
||||
plPlayerController.enableSlideFS.not) {
|
||||
return;
|
||||
}
|
||||
RenderBox renderBox =
|
||||
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
||||
final double totalWidth = renderBox.size.width;
|
||||
@@ -1173,6 +1185,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
// 左边区域
|
||||
gestureType = 'left';
|
||||
} else if (tapPosition < sectionWidth * 2) {
|
||||
if (plPlayerController.enableSlideFS.not) {
|
||||
return;
|
||||
}
|
||||
// 全屏
|
||||
gestureType = 'center';
|
||||
} else {
|
||||
|
||||
@@ -417,6 +417,9 @@ class GStorage {
|
||||
static bool get enableSlideVolumeBrightness => GStorage.setting
|
||||
.get(SettingBoxKey.enableSlideVolumeBrightness, defaultValue: true);
|
||||
|
||||
static bool get enableSlideFS =>
|
||||
GStorage.setting.get(SettingBoxKey.enableSlideFS, defaultValue: true);
|
||||
|
||||
static int get retryCount =>
|
||||
GStorage.setting.get(SettingBoxKey.retryCount, defaultValue: 2);
|
||||
|
||||
@@ -707,6 +710,7 @@ class SettingBoxKey {
|
||||
showDynActionBar = 'showDynActionBar',
|
||||
darkVideoPage = 'darkVideoPage',
|
||||
enableSlideVolumeBrightness = 'enableSlideVolumeBrightness',
|
||||
enableSlideFS = 'enableSlideFS',
|
||||
retryCount = 'retryCount',
|
||||
retryDelay = 'retryDelay',
|
||||
liveQuality = 'liveQuality',
|
||||
|
||||
Reference in New Issue
Block a user