opt: play speed

Closes #11

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-26 18:02:33 +08:00
parent 4df9f55e00
commit 1df218b313
6 changed files with 124 additions and 155 deletions

View File

@@ -251,7 +251,7 @@ class PlPlayerController {
late double strokeWidth;
late int fontWeight;
late double danmakuDurationVal;
late List<double> speedsList;
late List<double> speedList;
double? defaultDuration;
late bool enableAutoLongPressSpeed = false;
late bool enableLongShowControl;
@@ -374,12 +374,7 @@ class PlPlayerController {
}
enableLongShowControl =
setting.get(SettingBoxKey.enableLongShowControl, defaultValue: false);
speedsList = List<double>.from(videoStorage
.get(VideoBoxKey.customSpeedsList, defaultValue: <double>[]));
for (final PlaySpeed i in PlaySpeed.values) {
speedsList.add(i.value);
}
speedsList.sort();
speedList = GStorage.speedList;
// _playerEventSubs = onPlayerStatusChanged.listen((PlayerStatus status) {
// if (status == PlayerStatus.playing) {

View File

@@ -461,7 +461,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
initialValue: plPlayerController.playbackSpeed,
color: Colors.black.withOpacity(0.8),
itemBuilder: (BuildContext context) {
return plPlayerController.speedsList.map((double speed) {
return plPlayerController.speedList.map((double speed) {
return PopupMenuItem<double>(
height: 35,
padding: const EdgeInsets.only(left: 30),