feat: super resolution from kazumi/main

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-18 13:51:21 +08:00
parent 54cea9e5c7
commit 434a898c36
19 changed files with 3087 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ import 'dart:math';
import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/models/common/super_resolution_type.dart';
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
import 'package:PiliPlus/utils/id_utils.dart';
import 'package:easy_debounce/easy_throttle.dart';
@@ -335,6 +336,44 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
/// 空白占位
BottomControlType.space: const Spacer(),
/// 分段信息
BottomControlType.superResolution: Get.parameters['type'] == '1' ||
Get.parameters['type'] == '4'
? Container(
height: 30,
margin: const EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.center,
child: PopupMenuButton<SuperResolutionType>(
onSelected: (SuperResolutionType value) {
plPlayerController.setShader(value.index);
},
initialValue: SuperResolutionType
.values[plPlayerController.superResolutionType],
color: Colors.black.withOpacity(0.8),
itemBuilder: (BuildContext context) {
return SuperResolutionType.values
.map((SuperResolutionType type) {
return PopupMenuItem<SuperResolutionType>(
height: 35,
padding: const EdgeInsets.only(left: 30),
value: type,
child: Text(
type.title,
style:
const TextStyle(color: Colors.white, fontSize: 13),
),
);
}).toList();
},
child: Text(
SuperResolutionType
.values[plPlayerController.superResolutionType].title,
style: const TextStyle(color: Colors.white, fontSize: 13),
),
),
)
: const SizedBox.shrink(),
/// 分段信息
BottomControlType.viewPoints: Obx(
() => plPlayerController.viewPointList.isEmpty
@@ -544,6 +583,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
if (anySeason) BottomControlType.pre,
if (anySeason) BottomControlType.next,
BottomControlType.space,
BottomControlType.superResolution,
BottomControlType.viewPoints,
if (anySeason) BottomControlType.episode,
if (isFullScreen) BottomControlType.fit,