feat: 默认倍速、自定义倍速
This commit is contained in:
304
lib/pages/setting/pages/play_speed_set.dart
Normal file
304
lib/pages/setting/pages/play_speed_set.dart
Normal file
@ -0,0 +1,304 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
|
||||||
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
|
class PlaySpeedPage extends StatefulWidget {
|
||||||
|
const PlaySpeedPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PlaySpeedPage> createState() => _PlaySpeedPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||||
|
Box videoStorage = GStrorage.video;
|
||||||
|
late double playSpeedDefault;
|
||||||
|
late double longPressSpeedDefault;
|
||||||
|
late List customSpeedsList;
|
||||||
|
List<Map<dynamic, dynamic>> sheetMenu = [
|
||||||
|
{
|
||||||
|
'id': 1,
|
||||||
|
'title': '设置为默认倍速',
|
||||||
|
'leading': const Icon(
|
||||||
|
Icons.speed,
|
||||||
|
size: 21,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'id': 2,
|
||||||
|
'title': '设置为默认长按倍速',
|
||||||
|
'leading': const Icon(
|
||||||
|
Icons.speed_sharp,
|
||||||
|
size: 21,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'id': -1,
|
||||||
|
'title': '删除该项',
|
||||||
|
'leading': const Icon(
|
||||||
|
Icons.delete_outline,
|
||||||
|
size: 21,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
// 默认倍速
|
||||||
|
playSpeedDefault =
|
||||||
|
videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0);
|
||||||
|
// 默认长按倍速
|
||||||
|
longPressSpeedDefault =
|
||||||
|
videoStorage.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 2.0);
|
||||||
|
// 自定义倍速
|
||||||
|
customSpeedsList =
|
||||||
|
videoStorage.get(VideoBoxKey.customSpeedsList, defaultValue: []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加自定义倍速
|
||||||
|
void onAddSpeed() {
|
||||||
|
double customSpeed = 1.0;
|
||||||
|
SmartDialog.show(
|
||||||
|
useSystem: true,
|
||||||
|
animationType: SmartAnimationType.centerFade_otherSlide,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('添加倍速'),
|
||||||
|
content: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
// const Text('输入你想要的视频倍速,例如:1.0'),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
TextField(
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: '自定义倍速',
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(6.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onChanged: (e) {
|
||||||
|
customSpeed = double.parse(e);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => SmartDialog.dismiss(),
|
||||||
|
child: const Text('取消'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
customSpeedsList.add(customSpeed);
|
||||||
|
await videoStorage.put(
|
||||||
|
VideoBoxKey.customSpeedsList, customSpeedsList);
|
||||||
|
setState(() {});
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
},
|
||||||
|
child: const Text('确认添加'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设定倍速弹窗
|
||||||
|
void showBottomSheet(type, i) {
|
||||||
|
showModalBottomSheet<void>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.only(top: 10),
|
||||||
|
child: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const ClampingScrollPhysics(),
|
||||||
|
//重要
|
||||||
|
itemCount: sheetMenu.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
menuAction(type, i, sheetMenu[index]['id']);
|
||||||
|
},
|
||||||
|
minLeadingWidth: 0,
|
||||||
|
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||||
|
leading: sheetMenu[index]['leading'],
|
||||||
|
title: Text(
|
||||||
|
sheetMenu[index]['title'],
|
||||||
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void menuAction(type, index, id) async {
|
||||||
|
double chooseSpeed = 1.0;
|
||||||
|
if (type == 'system' && id == -1) {
|
||||||
|
SmartDialog.showToast('系统预设倍速不支持删除');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 获取当前选中的倍速值
|
||||||
|
if (type == 'system') {
|
||||||
|
chooseSpeed = PlaySpeed.values[index].value;
|
||||||
|
} else {
|
||||||
|
chooseSpeed = customSpeedsList[index];
|
||||||
|
}
|
||||||
|
// 设置
|
||||||
|
if (id == 1) {
|
||||||
|
// 设置默认倍速
|
||||||
|
playSpeedDefault = chooseSpeed;
|
||||||
|
videoStorage.put(VideoBoxKey.playSpeedDefault, playSpeedDefault);
|
||||||
|
} else if (id == 2) {
|
||||||
|
// 设置默认长按倍速
|
||||||
|
longPressSpeedDefault = chooseSpeed;
|
||||||
|
videoStorage.put(
|
||||||
|
VideoBoxKey.longPressSpeedDefault, longPressSpeedDefault);
|
||||||
|
} else if (id == -1) {
|
||||||
|
if (customSpeedsList[index] == playSpeedDefault) {
|
||||||
|
playSpeedDefault = 1.0;
|
||||||
|
videoStorage.put(VideoBoxKey.playSpeedDefault, playSpeedDefault);
|
||||||
|
}
|
||||||
|
if (customSpeedsList[index] == longPressSpeedDefault) {
|
||||||
|
longPressSpeedDefault = 2.0;
|
||||||
|
videoStorage.put(
|
||||||
|
VideoBoxKey.longPressSpeedDefault, longPressSpeedDefault);
|
||||||
|
}
|
||||||
|
customSpeedsList.removeAt(index);
|
||||||
|
await videoStorage.put(VideoBoxKey.customSpeedsList, customSpeedsList);
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
SmartDialog.showToast('操作成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
elevation: 0,
|
||||||
|
scrolledUnderElevation: 0,
|
||||||
|
titleSpacing: 0,
|
||||||
|
centerTitle: false,
|
||||||
|
title: Text(
|
||||||
|
'倍速设置',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(left: 14, right: 14, top: 6, bottom: 0),
|
||||||
|
child: Text(
|
||||||
|
'点击下方按钮设置默认(长按)倍速',
|
||||||
|
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
title: const Text('默认倍速'),
|
||||||
|
subtitle: Text(playSpeedDefault.toString()),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
title: const Text('默认长按倍速'),
|
||||||
|
subtitle: Text(longPressSpeedDefault.toString()),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 14,
|
||||||
|
right: 14,
|
||||||
|
bottom: 10,
|
||||||
|
top: 20,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'系统预设倍速',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 18,
|
||||||
|
right: 18,
|
||||||
|
bottom: 30,
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
alignment: WrapAlignment.start,
|
||||||
|
spacing: 8,
|
||||||
|
runSpacing: 2,
|
||||||
|
children: [
|
||||||
|
for (var i in PlaySpeed.values) ...[
|
||||||
|
FilledButton.tonal(
|
||||||
|
onPressed: () => showBottomSheet('system', i.index),
|
||||||
|
child: Text(i.description),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 14,
|
||||||
|
right: 14,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'自定义倍速',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => onAddSpeed(),
|
||||||
|
child: const Text('添加'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 18,
|
||||||
|
right: 18,
|
||||||
|
bottom: MediaQuery.of(context).padding.bottom + 40,
|
||||||
|
),
|
||||||
|
child: customSpeedsList.isNotEmpty
|
||||||
|
? Wrap(
|
||||||
|
alignment: WrapAlignment.start,
|
||||||
|
spacing: 8,
|
||||||
|
runSpacing: 2,
|
||||||
|
children: [
|
||||||
|
for (int i = 0; i < customSpeedsList.length; i++) ...[
|
||||||
|
FilledButton.tonal(
|
||||||
|
onPressed: () => showBottomSheet('custom', i),
|
||||||
|
child: Text(customSpeedsList[i].toString()),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: SizedBox(
|
||||||
|
height: 80,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'未添加',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).colorScheme.outline),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/models/video/play/quality.dart';
|
import 'package:pilipala/models/video/play/quality.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
@ -54,6 +55,12 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
onTap: () => Get.toNamed('/playSpeedSet'),
|
||||||
|
title: Text('倍速设置', style: titleStyle),
|
||||||
|
trailing: const Icon(Icons.arrow_forward_ios, size: 17),
|
||||||
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '开启1080P',
|
title: '开启1080P',
|
||||||
subTitle: '免登录查看1080P视频',
|
subTitle: '免登录查看1080P视频',
|
||||||
|
|||||||
@ -215,8 +215,6 @@ class VideoDetailController extends GetxController
|
|||||||
direction: (firstVideo.width! - firstVideo.height!) > 0
|
direction: (firstVideo.width! - firstVideo.height!) > 0
|
||||||
? 'horizontal'
|
? 'horizontal'
|
||||||
: 'vertical',
|
: 'vertical',
|
||||||
// 默认1倍速
|
|
||||||
speed: 1.0,
|
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
cid: cid.value,
|
cid: cid.value,
|
||||||
enableHeart: enableHeart,
|
enableHeart: enableHeart,
|
||||||
|
|||||||
@ -41,11 +41,14 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
TextStyle titleStyle = const TextStyle(fontSize: 14);
|
TextStyle titleStyle = const TextStyle(fontSize: 14);
|
||||||
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
||||||
Box localCache = GStrorage.localCache;
|
Box localCache = GStrorage.localCache;
|
||||||
|
Box videoStorage = GStrorage.video;
|
||||||
|
late List speedsList;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
videoInfo = widget.videoDetailCtr!.data;
|
videoInfo = widget.videoDetailCtr!.data;
|
||||||
|
speedsList = widget.controller!.speedsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 设置面板
|
/// 设置面板
|
||||||
@ -184,21 +187,25 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('播放速度'),
|
title: const Text('播放速度'),
|
||||||
contentPadding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
|
|
||||||
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
content: StatefulBuilder(builder: (context, StateSetter setState) {
|
||||||
return Column(
|
return Wrap(
|
||||||
mainAxisSize: MainAxisSize.min,
|
alignment: WrapAlignment.start,
|
||||||
|
spacing: 8,
|
||||||
|
runSpacing: 2,
|
||||||
children: [
|
children: [
|
||||||
Text('$currentSpeed倍'),
|
for (var i in speedsList) ...[
|
||||||
Slider(
|
if (i == currentSpeed) ...[
|
||||||
min: PlaySpeed.values.first.value,
|
FilledButton(
|
||||||
max: PlaySpeed.values.last.value,
|
onPressed: () => {setState(() => currentSpeed = i)},
|
||||||
value: currentSpeed,
|
child: Text(i.toString()),
|
||||||
divisions: PlaySpeed.values.length - 1,
|
),
|
||||||
label: '${currentSpeed}x',
|
] else ...[
|
||||||
onChanged: (double val) =>
|
FilledButton.tonal(
|
||||||
{setState(() => currentSpeed = val)},
|
onPressed: () => {setState(() => currentSpeed = i)},
|
||||||
)
|
child: Text(i.toString()),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
]
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -55,6 +55,7 @@ class PlPlayerController {
|
|||||||
final Rx<int> _playerCount = Rx(0);
|
final Rx<int> _playerCount = Rx(0);
|
||||||
|
|
||||||
final Rx<double> _playbackSpeed = 1.0.obs;
|
final Rx<double> _playbackSpeed = 1.0.obs;
|
||||||
|
final Rx<double> _longPressSpeed = 2.0.obs;
|
||||||
final Rx<double> _currentVolume = 1.0.obs;
|
final Rx<double> _currentVolume = 1.0.obs;
|
||||||
final Rx<double> _currentBrightness = 0.0.obs;
|
final Rx<double> _currentBrightness = 0.0.obs;
|
||||||
|
|
||||||
@ -127,6 +128,9 @@ class PlPlayerController {
|
|||||||
/// 视频播放速度
|
/// 视频播放速度
|
||||||
double get playbackSpeed => _playbackSpeed.value;
|
double get playbackSpeed => _playbackSpeed.value;
|
||||||
|
|
||||||
|
// 长按倍速
|
||||||
|
double get longPressSpeed => _longPressSpeed.value;
|
||||||
|
|
||||||
/// 视频缓冲
|
/// 视频缓冲
|
||||||
Rx<Duration> get buffered => _buffered;
|
Rx<Duration> get buffered => _buffered;
|
||||||
Stream<Duration> get onBufferedChanged => _buffered.stream;
|
Stream<Duration> get onBufferedChanged => _buffered.stream;
|
||||||
@ -209,6 +213,7 @@ class PlPlayerController {
|
|||||||
late double opacityVal;
|
late double opacityVal;
|
||||||
late double fontSizeVal;
|
late double fontSizeVal;
|
||||||
late double danmakuSpeedVal;
|
late double danmakuSpeedVal;
|
||||||
|
late List speedsList;
|
||||||
|
|
||||||
// 播放顺序相关
|
// 播放顺序相关
|
||||||
PlayRepeat playRepeat = PlayRepeat.pause;
|
PlayRepeat playRepeat = PlayRepeat.pause;
|
||||||
@ -236,6 +241,17 @@ class PlPlayerController {
|
|||||||
videoStorage.get(VideoBoxKey.playRepeat,
|
videoStorage.get(VideoBoxKey.playRepeat,
|
||||||
defaultValue: PlayRepeat.pause.value),
|
defaultValue: PlayRepeat.pause.value),
|
||||||
);
|
);
|
||||||
|
_playbackSpeed.value =
|
||||||
|
videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0);
|
||||||
|
_longPressSpeed.value =
|
||||||
|
videoStorage.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 2.0);
|
||||||
|
List speedsListTemp =
|
||||||
|
videoStorage.get(VideoBoxKey.customSpeedsList, defaultValue: []);
|
||||||
|
speedsList = List.from(speedsListTemp);
|
||||||
|
for (var i in PlaySpeed.values) {
|
||||||
|
speedsList.add(i.value);
|
||||||
|
}
|
||||||
|
|
||||||
// _playerEventSubs = onPlayerStatusChanged.listen((PlayerStatus status) {
|
// _playerEventSubs = onPlayerStatusChanged.listen((PlayerStatus status) {
|
||||||
// if (status == PlayerStatus.playing) {
|
// if (status == PlayerStatus.playing) {
|
||||||
// WakelockPlus.enable();
|
// WakelockPlus.enable();
|
||||||
@ -293,7 +309,7 @@ class PlPlayerController {
|
|||||||
_autoPlay = autoplay;
|
_autoPlay = autoplay;
|
||||||
_looping = looping;
|
_looping = looping;
|
||||||
// 初始化视频倍速
|
// 初始化视频倍速
|
||||||
_playbackSpeed.value = speed;
|
// _playbackSpeed.value = speed;
|
||||||
// 初始化数据加载状态
|
// 初始化数据加载状态
|
||||||
dataStatus.status.value = DataStatus.loading;
|
dataStatus.status.value = DataStatus.loading;
|
||||||
// 初始化全屏方向
|
// 初始化全屏方向
|
||||||
@ -772,11 +788,10 @@ class PlPlayerController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_doubleSpeedStatus.value = val;
|
_doubleSpeedStatus.value = val;
|
||||||
double currentSpeed = playbackSpeed;
|
|
||||||
if (val) {
|
if (val) {
|
||||||
setPlaybackSpeed(currentSpeed * 2);
|
setPlaybackSpeed(longPressSpeed);
|
||||||
} else {
|
} else {
|
||||||
setPlaybackSpeed(currentSpeed / 2);
|
setPlaybackSpeed(playbackSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,35 +9,18 @@ enum PlaySpeed {
|
|||||||
onePointSevenFive,
|
onePointSevenFive,
|
||||||
|
|
||||||
two,
|
two,
|
||||||
twoPointTwoFive,
|
|
||||||
twoPointFive,
|
|
||||||
twoPointSevenFive,
|
|
||||||
|
|
||||||
twhree,
|
|
||||||
threePointTwoFive,
|
|
||||||
threePointFive,
|
|
||||||
threePointSevenFive,
|
|
||||||
|
|
||||||
four,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension PlaySpeedExtension on PlaySpeed {
|
extension PlaySpeedExtension on PlaySpeed {
|
||||||
static final List<String> _descList = [
|
static final List<String> _descList = [
|
||||||
'0.25倍',
|
'0.25',
|
||||||
'0.5倍',
|
'0.5',
|
||||||
'0.75倍',
|
'0.75',
|
||||||
'正常速度',
|
'正常',
|
||||||
'1.25倍',
|
'1.25',
|
||||||
'1.5倍',
|
'1.5',
|
||||||
'2.0倍',
|
'1.75',
|
||||||
'2.25倍',
|
'2.0',
|
||||||
'2.5倍',
|
|
||||||
'2.75倍',
|
|
||||||
'3.0倍',
|
|
||||||
'3.25倍',
|
|
||||||
'3.5倍',
|
|
||||||
'3.75倍',
|
|
||||||
'4.0倍'
|
|
||||||
];
|
];
|
||||||
get description => _descList[index];
|
get description => _descList[index];
|
||||||
|
|
||||||
@ -50,14 +33,6 @@ extension PlaySpeedExtension on PlaySpeed {
|
|||||||
1.5,
|
1.5,
|
||||||
1.75,
|
1.75,
|
||||||
2.0,
|
2.0,
|
||||||
2.25,
|
|
||||||
2.5,
|
|
||||||
2.75,
|
|
||||||
3.0,
|
|
||||||
3.25,
|
|
||||||
3.5,
|
|
||||||
3.75,
|
|
||||||
4.0,
|
|
||||||
];
|
];
|
||||||
get value => _valueList[index];
|
get value => _valueList[index];
|
||||||
get defaultValue => _valueList[3];
|
get defaultValue => _valueList[3];
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import 'package:pilipala/pages/setting/extra_setting.dart';
|
|||||||
import 'package:pilipala/pages/setting/pages/color_select.dart';
|
import 'package:pilipala/pages/setting/pages/color_select.dart';
|
||||||
import 'package:pilipala/pages/setting/pages/display_mode.dart';
|
import 'package:pilipala/pages/setting/pages/display_mode.dart';
|
||||||
import 'package:pilipala/pages/setting/pages/font_size_select.dart';
|
import 'package:pilipala/pages/setting/pages/font_size_select.dart';
|
||||||
|
import 'package:pilipala/pages/setting/pages/play_speed_set.dart';
|
||||||
import 'package:pilipala/pages/setting/play_setting.dart';
|
import 'package:pilipala/pages/setting/play_setting.dart';
|
||||||
import 'package:pilipala/pages/setting/privacy_setting.dart';
|
import 'package:pilipala/pages/setting/privacy_setting.dart';
|
||||||
import 'package:pilipala/pages/setting/style_setting.dart';
|
import 'package:pilipala/pages/setting/style_setting.dart';
|
||||||
@ -116,6 +117,8 @@ class Routes {
|
|||||||
// 历史记录搜索
|
// 历史记录搜索
|
||||||
CustomGetPage(
|
CustomGetPage(
|
||||||
name: '/historySearch', page: () => const HistorySearchPage()),
|
name: '/historySearch', page: () => const HistorySearchPage()),
|
||||||
|
|
||||||
|
CustomGetPage(name: '/playSpeedSet', page: () => const PlaySpeedPage()),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -162,4 +162,10 @@ class VideoBoxKey {
|
|||||||
static const String videoSpeed = 'videoSpeed';
|
static const String videoSpeed = 'videoSpeed';
|
||||||
// 播放顺序
|
// 播放顺序
|
||||||
static const String playRepeat = 'playRepeat';
|
static const String playRepeat = 'playRepeat';
|
||||||
|
// 默认倍速
|
||||||
|
static const String playSpeedDefault = 'playSpeedDefault';
|
||||||
|
// 默认长按倍速
|
||||||
|
static const String longPressSpeedDefault = 'longPressSpeedDefault';
|
||||||
|
// 自定义倍速集合
|
||||||
|
static const String customSpeedsList = 'customSpeedsList';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user