mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 移除顶部控制栏倍速播放,番剧等无标题去除显示(后续支持)
This commit is contained in:
@@ -49,7 +49,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
||||||
final Box<dynamic> localCache = GStrorage.localCache;
|
final Box<dynamic> localCache = GStrorage.localCache;
|
||||||
final Box<dynamic> videoStorage = GStrorage.video;
|
final Box<dynamic> videoStorage = GStrorage.video;
|
||||||
late List<double> speedsList;
|
|
||||||
double buttonSpace = 8;
|
double buttonSpace = 8;
|
||||||
bool isFullScreen = false;
|
bool isFullScreen = false;
|
||||||
late String heroTag;
|
late String heroTag;
|
||||||
@@ -62,7 +61,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
videoInfo = widget.videoDetailCtr!.data;
|
videoInfo = widget.videoDetailCtr!.data;
|
||||||
speedsList = widget.controller!.speedsList;
|
|
||||||
listenFullScreenStatus();
|
listenFullScreenStatus();
|
||||||
heroTag = Get.arguments['heroTag'];
|
heroTag = Get.arguments['heroTag'];
|
||||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
||||||
@@ -428,65 +426,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 选择倍速
|
|
||||||
void showSetSpeedSheet() {
|
|
||||||
final double currentSpeed = widget.controller!.playbackSpeed;
|
|
||||||
showDialog(
|
|
||||||
context: Get.context!,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('播放速度'),
|
|
||||||
content: StatefulBuilder(
|
|
||||||
builder: (BuildContext context, StateSetter setState) {
|
|
||||||
return Wrap(
|
|
||||||
spacing: 8,
|
|
||||||
runSpacing: 2,
|
|
||||||
children: [
|
|
||||||
for (final double i in speedsList) ...<Widget>[
|
|
||||||
if (i == currentSpeed) ...<Widget>[
|
|
||||||
FilledButton(
|
|
||||||
onPressed: () async {
|
|
||||||
// setState(() => currentSpeed = i),
|
|
||||||
await widget.controller!.setPlaybackSpeed(i);
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i.toString()),
|
|
||||||
),
|
|
||||||
] else ...[
|
|
||||||
FilledButton.tonal(
|
|
||||||
onPressed: () async {
|
|
||||||
// setState(() => currentSpeed = i),
|
|
||||||
await widget.controller!.setPlaybackSpeed(i);
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text(i.toString()),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(),
|
|
||||||
child: Text(
|
|
||||||
'取消',
|
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await widget.controller!.setDefaultSpeed();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: const Text('默认速度'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 选择画质
|
/// 选择画质
|
||||||
void showSetVideoQa() {
|
void showSetVideoQa() {
|
||||||
final List<FormatItem> videoFormat = videoInfo.supportFormats!;
|
final List<FormatItem> videoFormat = videoInfo.supportFormats!;
|
||||||
@@ -1073,10 +1012,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final _ = widget.controller!;
|
final _ = widget.controller!;
|
||||||
const TextStyle textStyle = TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 12,
|
|
||||||
);
|
|
||||||
final bool isLandscape =
|
final bool isLandscape =
|
||||||
MediaQuery.of(context).orientation == Orientation.landscape;
|
MediaQuery.of(context).orientation == Orientation.landscape;
|
||||||
return AppBar(
|
return AppBar(
|
||||||
@@ -1113,14 +1048,14 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(width: buttonSpace),
|
SizedBox(width: buttonSpace),
|
||||||
if (isFullScreen ||
|
if ((videoIntroController.videoDetail.value.title != null) && (isFullScreen ||
|
||||||
(!isFullScreen && isLandscape && !horizontalScreen)) ...[
|
(!isFullScreen && isLandscape && !horizontalScreen))) ...[
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: isLandscape ? 400 : 100, maxHeight: 20),
|
maxWidth: isLandscape ? 400 : 150, maxHeight: 20),
|
||||||
child: Marquee(
|
child: Marquee(
|
||||||
text: videoIntroController.videoDetail.value.title!,
|
text: videoIntroController.videoDetail.value.title!,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
@@ -1246,23 +1181,6 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
),
|
),
|
||||||
SizedBox(width: buttonSpace),
|
SizedBox(width: buttonSpace),
|
||||||
],
|
],
|
||||||
Obx(
|
|
||||||
() => SizedBox(
|
|
||||||
width: 34,
|
|
||||||
height: 34,
|
|
||||||
child: TextButton(
|
|
||||||
style: ButtonStyle(
|
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
|
||||||
),
|
|
||||||
onPressed: () => showSetSpeedSheet(),
|
|
||||||
child: Text(
|
|
||||||
'${_.playbackSpeed}X',
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: buttonSpace),
|
|
||||||
ComBtn(
|
ComBtn(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.more_vert_outlined,
|
Icons.more_vert_outlined,
|
||||||
|
|||||||
Reference in New Issue
Block a user