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