feat: 增加播放控件消失时间延长10倍的设置

This commit is contained in:
orz12
2024-08-25 23:54:05 +08:00
parent d2b8c01ac4
commit a51aa1ce13
4 changed files with 15 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ class _PlaySettingState extends State<PlaySetting> {
),
const SetSwitchItem(
title: '双击快退/快进',
subTitle: '左侧双击快退右侧双击快进',
subTitle: '左侧双击快退/右侧双击快进,关闭则双击均为暂停/播放',
leading: Icon(Icons.touch_app_outlined),
setKey: SettingBoxKey.enableQuickDouble,
defaultVal: true,
@@ -139,6 +139,13 @@ class _PlaySettingState extends State<PlaySetting> {
setKey: SettingBoxKey.enableAutoExit,
defaultVal: true,
),
const SetSwitchItem(
title: '延长播放控件显示时间',
subTitle: '开启后延长至30秒便于屏幕阅读器滑动切换控件焦点',
leading: Icon(Icons.timer_outlined),
setKey: SettingBoxKey.enableLongShowControl,
defaultVal: false
),
const SetSwitchItem(
title: '全向旋转',
subTitle: '小屏可受重力转为临时全屏,若系统锁定旋转仍触发请关闭,关闭会影响横屏适配',

View File

@@ -69,7 +69,7 @@ class _StyleSettingState extends State<StyleSetting> {
children: [
SetSwitchItem(
title: '横屏适配',
subTitle: '启用横屏布局与逻辑,适用于平板等设备;推荐全屏方向设为【不改变当前方向】',
subTitle: '启用横屏布局与逻辑,平板、折叠屏等可开启;建议全屏方向设为【不改变当前方向】',
leading: const Icon(Icons.phonelink_outlined),
setKey: SettingBoxKey.horizontalScreen,
defaultVal: false,

View File

@@ -253,6 +253,7 @@ class PlPlayerController {
late List<double> speedsList;
double? defaultDuration;
late bool enableAutoLongPressSpeed = false;
late bool enableLongShowControl;
// 播放顺序相关
PlayRepeat playRepeat = PlayRepeat.pause;
@@ -361,6 +362,8 @@ class PlPlayerController {
_longPressSpeed.value = videoStorage
.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);
}
enableLongShowControl =
setting.get(SettingBoxKey.enableLongShowControl, defaultValue: false);
speedsList = List<double>.from(videoStorage
.get(VideoBoxKey.customSpeedsList, defaultValue: <double>[]));
for (final PlaySpeed i in PlaySpeed.values) {
@@ -927,7 +930,8 @@ class PlPlayerController {
if (_timer != null) {
_timer!.cancel();
}
_timer = Timer(const Duration(milliseconds: 3000), () {
Duration waitingTime = Duration(seconds: enableLongShowControl ? 30 : 3);
_timer = Timer(waitingTime, () {
if (!isSliderMoving.value) {
controls = false;
}

View File

@@ -112,6 +112,7 @@ class SettingBoxKey {
enableAutoBrightness = 'enableAutoBrightness',
enableAutoEnter = 'enableAutoEnter',
enableAutoExit = 'enableAutoExit',
enableLongShowControl = 'enableLongShowControl',
allowRotateScreen = 'allowRotateScreen',
horizontalScreen = 'horizontalScreen',
p1080 = 'p1080',