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,
|
setKey: SettingBoxKey.enableSlideVolumeBrightness,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
|
SettingsModel(
|
||||||
|
settingsType: SettingsType.sw1tch,
|
||||||
|
title: '中间滑动进入/退出全屏',
|
||||||
|
leading: Icon(MdiIcons.panVertical),
|
||||||
|
setKey: SettingBoxKey.enableSlideFS,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
SettingsModel(
|
SettingsModel(
|
||||||
settingsType: SettingsType.normal,
|
settingsType: SettingsType.normal,
|
||||||
title: '自动启用字幕',
|
title: '自动启用字幕',
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class PlPlayerController {
|
|||||||
late final enableShrinkVideoSize = GStorage.enableShrinkVideoSize;
|
late final enableShrinkVideoSize = GStorage.enableShrinkVideoSize;
|
||||||
late final darkVideoPage = GStorage.darkVideoPage;
|
late final darkVideoPage = GStorage.darkVideoPage;
|
||||||
late final enableSlideVolumeBrightness = GStorage.enableSlideVolumeBrightness;
|
late final enableSlideVolumeBrightness = GStorage.enableSlideVolumeBrightness;
|
||||||
|
late final enableSlideFS = GStorage.enableSlideFS;
|
||||||
|
|
||||||
/// 弹幕权重
|
/// 弹幕权重
|
||||||
int danmakuWeight = 0;
|
int danmakuWeight = 0;
|
||||||
|
|||||||
@@ -767,6 +767,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
/// 锁定时禁用
|
/// 锁定时禁用
|
||||||
if (plPlayerController.controlsLock.value) return;
|
if (plPlayerController.controlsLock.value) return;
|
||||||
|
if (plPlayerController.enableSlideVolumeBrightness.not &&
|
||||||
|
plPlayerController.enableSlideFS.not) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RenderBox renderBox =
|
RenderBox renderBox =
|
||||||
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
||||||
|
|
||||||
@@ -788,6 +793,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
// 左边区域
|
// 左边区域
|
||||||
_gestureType = 'left';
|
_gestureType = 'left';
|
||||||
} else if (tapPosition < sectionWidth * 2) {
|
} else if (tapPosition < sectionWidth * 2) {
|
||||||
|
if (plPlayerController.enableSlideFS.not) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 全屏
|
// 全屏
|
||||||
_gestureType = 'center';
|
_gestureType = 'center';
|
||||||
} else {
|
} else {
|
||||||
@@ -1160,6 +1168,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
},
|
},
|
||||||
onVerticalDragUpdate: (details) {
|
onVerticalDragUpdate: (details) {
|
||||||
if (plPlayerController.controlsLock.value) return;
|
if (plPlayerController.controlsLock.value) return;
|
||||||
|
if (plPlayerController.enableSlideVolumeBrightness.not &&
|
||||||
|
plPlayerController.enableSlideFS.not) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
RenderBox renderBox =
|
RenderBox renderBox =
|
||||||
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
_playerKey.currentContext!.findRenderObject() as RenderBox;
|
||||||
final double totalWidth = renderBox.size.width;
|
final double totalWidth = renderBox.size.width;
|
||||||
@@ -1173,6 +1185,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
// 左边区域
|
// 左边区域
|
||||||
gestureType = 'left';
|
gestureType = 'left';
|
||||||
} else if (tapPosition < sectionWidth * 2) {
|
} else if (tapPosition < sectionWidth * 2) {
|
||||||
|
if (plPlayerController.enableSlideFS.not) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 全屏
|
// 全屏
|
||||||
gestureType = 'center';
|
gestureType = 'center';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -417,6 +417,9 @@ class GStorage {
|
|||||||
static bool get enableSlideVolumeBrightness => GStorage.setting
|
static bool get enableSlideVolumeBrightness => GStorage.setting
|
||||||
.get(SettingBoxKey.enableSlideVolumeBrightness, defaultValue: true);
|
.get(SettingBoxKey.enableSlideVolumeBrightness, defaultValue: true);
|
||||||
|
|
||||||
|
static bool get enableSlideFS =>
|
||||||
|
GStorage.setting.get(SettingBoxKey.enableSlideFS, defaultValue: true);
|
||||||
|
|
||||||
static int get retryCount =>
|
static int get retryCount =>
|
||||||
GStorage.setting.get(SettingBoxKey.retryCount, defaultValue: 2);
|
GStorage.setting.get(SettingBoxKey.retryCount, defaultValue: 2);
|
||||||
|
|
||||||
@@ -707,6 +710,7 @@ class SettingBoxKey {
|
|||||||
showDynActionBar = 'showDynActionBar',
|
showDynActionBar = 'showDynActionBar',
|
||||||
darkVideoPage = 'darkVideoPage',
|
darkVideoPage = 'darkVideoPage',
|
||||||
enableSlideVolumeBrightness = 'enableSlideVolumeBrightness',
|
enableSlideVolumeBrightness = 'enableSlideVolumeBrightness',
|
||||||
|
enableSlideFS = 'enableSlideFS',
|
||||||
retryCount = 'retryCount',
|
retryCount = 'retryCount',
|
||||||
retryDelay = 'retryDelay',
|
retryDelay = 'retryDelay',
|
||||||
liveQuality = 'liveQuality',
|
liveQuality = 'liveQuality',
|
||||||
|
|||||||
Reference in New Issue
Block a user