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

@@ -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;
}