feat: 播放器控制栏动画开关
This commit is contained in:
@ -7,6 +7,7 @@ import 'package:pilipala/models/video/play/quality.dart';
|
||||
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||
import 'package:pilipala/services/service_locator.dart';
|
||||
import 'package:pilipala/utils/global_data.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
import 'widgets/switch_item.dart';
|
||||
@ -146,6 +147,14 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
setKey: SettingBoxKey.enableShowDanmaku,
|
||||
defaultVal: false,
|
||||
),
|
||||
SetSwitchItem(
|
||||
title: '控制栏动画',
|
||||
subTitle: '播放器控制栏显示动画效果',
|
||||
setKey: SettingBoxKey.enablePlayerControlAnimation,
|
||||
defaultVal: true,
|
||||
callFn: (bool val) {
|
||||
GlobalData().enablePlayerControlAnimation = val;
|
||||
}),
|
||||
ListTile(
|
||||
dense: false,
|
||||
title: Text('默认画质', style: titleStyle),
|
||||
|
@ -120,7 +120,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
super.initState();
|
||||
screenWidth = Get.size.width;
|
||||
animationController = AnimationController(
|
||||
vsync: this, duration: const Duration(milliseconds: 300));
|
||||
vsync: this,
|
||||
duration: GlobalData().enablePlayerControlAnimation
|
||||
? const Duration(milliseconds: 150)
|
||||
: const Duration(milliseconds: 10),
|
||||
);
|
||||
videoController = widget.controller.videoController!;
|
||||
widget.controller.headerControl = widget.headerControl;
|
||||
widget.controller.bottomControl = widget.bottomControl;
|
||||
|
@ -4,6 +4,7 @@ class GlobalData {
|
||||
int imgQuality = 10;
|
||||
FullScreenGestureMode fullScreenGestureMode =
|
||||
FullScreenGestureMode.values.last;
|
||||
bool enablePlayerControlAnimation = true;
|
||||
|
||||
// 私有构造函数
|
||||
GlobalData._();
|
||||
|
@ -49,6 +49,8 @@ class GStrorage {
|
||||
GlobalData().fullScreenGestureMode = FullScreenGestureMode.values[
|
||||
setting.get(SettingBoxKey.fullScreenGestureMode,
|
||||
defaultValue: FullScreenGestureMode.values.last.index) as int];
|
||||
GlobalData().enablePlayerControlAnimation = setting
|
||||
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
||||
}
|
||||
|
||||
static void regAdapter() {
|
||||
@ -98,6 +100,7 @@ class SettingBoxKey {
|
||||
enableCDN = 'enableCDN',
|
||||
autoPiP = 'autoPiP',
|
||||
enableAutoLongPressSpeed = 'enableAutoLongPressSpeed',
|
||||
enablePlayerControlAnimation = 'enablePlayerControlAnimation',
|
||||
|
||||
// youtube 双击快进快退
|
||||
enableQuickDouble = 'enableQuickDouble',
|
||||
|
Reference in New Issue
Block a user