chore: clean up

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-20 11:21:19 +08:00
parent ed60c274fc
commit 538494b7ec
90 changed files with 495 additions and 1816 deletions

View File

@@ -1074,20 +1074,7 @@ class PlPlayerController {
_playbackSpeed.value = speed;
}
/// 设置倍速
// Future<void> togglePlaybackSpeed() async {
// List<double> allowedSpeeds =
// PlaySpeed.values.map<double>((e) => e.value).toList();
// int index = allowedSpeeds.indexOf(_playbackSpeed.value);
// if (index < allowedSpeeds.length - 1) {
// setPlaybackSpeed(allowedSpeeds[index + 1]);
// } else {
// setPlaybackSpeed(allowedSpeeds[0]);
// }
// }
/// 播放视频
/// TODO _duration.value丢失
Future<void> play({bool repeat = false, bool hideControls = true}) async {
if (_playerCount.value == 0) return;
// 播放时自动隐藏控制条
@@ -1104,14 +1091,6 @@ class PlPlayerController {
// screenManager.setOverlays(false);
audioSessionHandler.setActive(true);
// Future.delayed(const Duration(milliseconds: 100), () {
// getCurrentVolume();
// if (setting.get(SettingBoxKey.enableAutoBrightness, defaultValue: true)
// as bool) {
// getCurrentBrightness();
// }
// });
}
/// 暂停播放
@@ -1246,46 +1225,6 @@ class PlPlayerController {
_videoFitDesc.value = videoFitType[value.index]['desc'];
setVideoFit();
getPlayerKey?.call().currentState?.update(fit: value);
// showDialog(
// context: Get.context!,
// builder: (context) {
// return AlertDialog(
// title: const Text('视频尺寸'),
// content: StatefulBuilder(builder: (context, StateSetter setState) {
// return Wrap(
// alignment: WrapAlignment.start,
// spacing: 8,
// runSpacing: 2,
// children: [
// for (var i in videoFitType) ...[
// if (_videoFit.value == i['attr']) ...[
// FilledButton(
// onPressed: () async {
// _videoFit.value = i['attr'];
// _videoFitDesc.value = i['desc'];
// setVideoFit();
// Get.back();
// },
// child: Text(i['desc']),
// ),
// ] else ...[
// FilledButton.tonal(
// onPressed: () async {
// _videoFit.value = i['attr'];
// _videoFitDesc.value = i['desc'];
// setVideoFit();
// Get.back();
// },
// child: Text(i['desc']),
// ),
// ]
// ]
// ],
// );
// }),
// );
// },
// );
}
/// 缓存fit

View File

@@ -1,5 +1,4 @@
enum PlaySpeed {
// pointTwoFive,
pointFive,
pointSevenFive,
@@ -14,7 +13,6 @@ enum PlaySpeed {
extension PlaySpeedExtension on PlaySpeed {
static final List<String> _descList = [
// '0.25',
'0.5',
'0.75',
'正常',
@@ -27,7 +25,6 @@ extension PlaySpeedExtension on PlaySpeed {
String get description => _descList[index];
static final List<double> _valueList = [
// 0.25,
0.5,
0.75,
1.0,

View File

@@ -1645,7 +1645,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
),
),
),
//
Obx(() {
if (plPlayerController.dataStatus.loading ||
plPlayerController.isBuffering.value) {
@@ -1888,14 +1888,6 @@ Widget buildSeekPreviewWidget(PlPlayerController plPlayerController) {
padding: EdgeInsets.only(left: left),
child: UnconstrainedBox(
child: ClipRRect(
// clipBehavior: Clip.antiAlias,
// decoration: BoxDecoration(
// border: Border.all(
// color: Colors.white,
// strokeAlign: BorderSide.strokeAlignOutside,
// ),
// borderRadius: BorderRadius.circular(scale == 2.5 ? 6 : 10),
// ),
borderRadius: BorderRadius.circular(scale == 2.5 ? 6 : 10),
child: Align(
widthFactor: 0.1,

View File

@@ -3,13 +3,11 @@ import 'dart:async';
import 'package:flutter/material.dart';
class BackwardSeekIndicator extends StatefulWidget {
// final void Function(Duration) onChanged;
final ValueChanged<Duration> onSubmitted;
final int duration;
const BackwardSeekIndicator({
super.key,
// required this.onChanged,
required this.onSubmitted,
required this.duration,
});
@@ -43,8 +41,6 @@ class BackwardSeekIndicatorState extends State<BackwardSeekIndicator> {
timer = Timer(const Duration(milliseconds: 400), () {
widget.onSubmitted.call(duration);
});
// widget.onChanged.call(value);
// 重复点击 快退秒数累加10
setState(() {
duration += Duration(seconds: widget.duration);
});

View File

@@ -50,9 +50,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
return Padding(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 7),
child: Semantics(
// label: '${(value / max * 100).round()}%',
value: '${(value / max * 100).round()}%',
// enabled: false,
child: Stack(
clipBehavior: Clip.none,
alignment: Alignment.bottomCenter,

View File

@@ -3,13 +3,11 @@ import 'dart:async';
import 'package:flutter/material.dart';
class ForwardSeekIndicator extends StatefulWidget {
// final void Function(Duration) onChanged;
final ValueChanged<Duration> onSubmitted;
final int duration;
const ForwardSeekIndicator({
super.key,
// required this.onChanged,
required this.onSubmitted,
required this.duration,
});
@@ -43,8 +41,6 @@ class ForwardSeekIndicatorState extends State<ForwardSeekIndicator> {
timer = Timer(const Duration(milliseconds: 400), () {
widget.onSubmitted.call(duration);
});
// widget.onChanged.call(value);
// 重复点击 快进秒数累加10
setState(() {
duration += Duration(seconds: widget.duration);
});

View File

@@ -77,8 +77,6 @@ class PlayOrPauseButtonState extends State<PlayOrPauseButton>
player.playOrPause();
}
},
// iconSize: widget.iconSize ?? _theme(context).buttonBarButtonSize,
// color: widget.iconColor ?? _theme(context).buttonBarButtonColor,
child: Center(
child: AnimatedIcon(
semanticLabel:
@@ -89,8 +87,6 @@ class PlayOrPauseButtonState extends State<PlayOrPauseButton>
icon: AnimatedIcons.play_pause,
color: Colors.white,
size: 20,
// size: widget.iconSize ?? _theme(context).buttonBarButtonSize,
// color: widget.iconColor ?? _theme(context).buttonBarButtonColor,
),
),
),