mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-20 02:20:11 +08:00
committed by
GitHub
parent
c899ea95e1
commit
8d34e6f340
@@ -1169,10 +1169,10 @@ class VideoDetailController extends GetxController
|
||||
id: data.quality!,
|
||||
baseUrl: videoUrl,
|
||||
codecs: 'avc1',
|
||||
quality: VideoQualityExt.fromCode(data.quality!)!);
|
||||
quality: VideoQuality.fromCode(data.quality!));
|
||||
setVideoHeight();
|
||||
currentDecodeFormats = VideoDecodeFormatTypeExt.fromString('avc1')!;
|
||||
currentVideoQa = VideoQualityExt.fromCode(data.quality!)!;
|
||||
currentVideoQa = VideoQuality.fromCode(data.quality!);
|
||||
if (autoPlay.value) {
|
||||
isShowCover.value = false;
|
||||
await playerInit();
|
||||
@@ -1196,7 +1196,7 @@ class VideoDetailController extends GetxController
|
||||
final List<VideoItem> allVideosList = data.dash!.video!;
|
||||
// debugPrint("allVideosList:${allVideosList}");
|
||||
// 当前可播放的最高质量视频
|
||||
int currentHighVideoQa = allVideosList.first.quality!.code;
|
||||
int currentHighVideoQa = allVideosList.first.quality.code;
|
||||
// 预设的画质为null,则当前可用的最高质量
|
||||
int resVideoQa = currentHighVideoQa;
|
||||
if (plPlayerController.cacheVideoQa! <= currentHighVideoQa) {
|
||||
@@ -1206,11 +1206,11 @@ class VideoDetailController extends GetxController
|
||||
resVideoQa =
|
||||
Utils.findClosestNumber(plPlayerController.cacheVideoQa!, numbers);
|
||||
}
|
||||
currentVideoQa = VideoQualityExt.fromCode(resVideoQa)!;
|
||||
currentVideoQa = VideoQuality.fromCode(resVideoQa);
|
||||
|
||||
/// 取出符合当前画质的videoList
|
||||
final List<VideoItem> videosList =
|
||||
allVideosList.where((e) => e.quality!.code == resVideoQa).toList();
|
||||
allVideosList.where((e) => e.quality.code == resVideoQa).toList();
|
||||
|
||||
/// 优先顺序 设置中指定解码格式 -> 当前可选的首个解码格式
|
||||
final List<FormatItem> supportFormats = data.supportFormats!;
|
||||
@@ -1274,7 +1274,7 @@ class VideoDetailController extends GetxController
|
||||
orElse: () => audiosList.first);
|
||||
audioUrl = VideoUtils.getCdnUrl(firstAudio);
|
||||
if (firstAudio.id != null) {
|
||||
currentAudioQa = AudioQualityExt.fromCode(firstAudio.id!)!;
|
||||
currentAudioQa = AudioQuality.fromCode(firstAudio.id!);
|
||||
}
|
||||
} else {
|
||||
firstAudio = AudioItem();
|
||||
|
||||
@@ -650,7 +650,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
final int quality = videoFormat[i].quality!;
|
||||
videoDetailCtr
|
||||
..currentVideoQa =
|
||||
VideoQualityExt.fromCode(quality)!
|
||||
VideoQuality.fromCode(quality)
|
||||
..updatePlayer();
|
||||
|
||||
// update
|
||||
@@ -659,16 +659,16 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
.checkConnectivity()
|
||||
.then((res) {
|
||||
if (res.contains(ConnectivityResult.wifi)) {
|
||||
oldQualityDesc = VideoQualityExt.fromCode(
|
||||
GStorage.defaultVideoQa)!
|
||||
oldQualityDesc = VideoQuality.fromCode(
|
||||
GStorage.defaultVideoQa)
|
||||
.description;
|
||||
setting.put(
|
||||
SettingBoxKey.defaultVideoQa,
|
||||
quality,
|
||||
);
|
||||
} else {
|
||||
oldQualityDesc = VideoQualityExt.fromCode(
|
||||
GStorage.defaultVideoQaCellular)!
|
||||
oldQualityDesc = VideoQuality.fromCode(
|
||||
GStorage.defaultVideoQaCellular)
|
||||
.description;
|
||||
setting.put(
|
||||
SettingBoxKey.defaultVideoQaCellular,
|
||||
@@ -677,7 +677,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
}
|
||||
});
|
||||
SmartDialog.showToast(
|
||||
"默认画质由:$oldQualityDesc 变为:${VideoQualityExt.fromCode(quality)!.description}",
|
||||
"默认画质由:$oldQualityDesc 变为:${VideoQuality.fromCode(quality).description}",
|
||||
);
|
||||
},
|
||||
// 可能包含会员解锁画质
|
||||
@@ -745,7 +745,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
final int quality = i.id!;
|
||||
videoDetailCtr
|
||||
..currentAudioQa =
|
||||
AudioQualityExt.fromCode(quality)!
|
||||
AudioQuality.fromCode(quality)
|
||||
..updatePlayer();
|
||||
|
||||
// update
|
||||
@@ -754,16 +754,16 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
.checkConnectivity()
|
||||
.then((res) {
|
||||
if (res.contains(ConnectivityResult.wifi)) {
|
||||
oldQualityDesc = AudioQualityExt.fromCode(
|
||||
GStorage.defaultAudioQa)!
|
||||
oldQualityDesc = AudioQuality.fromCode(
|
||||
GStorage.defaultAudioQa)
|
||||
.description;
|
||||
setting.put(
|
||||
SettingBoxKey.defaultAudioQa,
|
||||
quality,
|
||||
);
|
||||
} else {
|
||||
oldQualityDesc = AudioQualityExt.fromCode(
|
||||
GStorage.defaultAudioQaCellular)!
|
||||
oldQualityDesc = AudioQuality.fromCode(
|
||||
GStorage.defaultAudioQaCellular)
|
||||
.description;
|
||||
setting.put(
|
||||
SettingBoxKey.defaultAudioQaCellular,
|
||||
@@ -772,12 +772,12 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
}
|
||||
});
|
||||
SmartDialog.showToast(
|
||||
"默认音质由:$oldQualityDesc 变为:${AudioQualityExt.fromCode(quality)!.description}",
|
||||
"默认音质由:$oldQualityDesc 变为:${AudioQuality.fromCode(quality).description}",
|
||||
);
|
||||
},
|
||||
contentPadding:
|
||||
const EdgeInsets.only(left: 20, right: 20),
|
||||
title: Text(i.quality!),
|
||||
title: Text(i.quality),
|
||||
subtitle: Text(
|
||||
i.codecs!,
|
||||
style: subTitleStyle,
|
||||
@@ -811,7 +811,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
// 当前视频可用的解码格式
|
||||
final List<FormatItem> videoFormat = videoInfo.supportFormats!;
|
||||
final List? list = videoFormat
|
||||
.firstWhere((FormatItem e) => e.quality == firstVideo.quality!.code)
|
||||
.firstWhere((FormatItem e) => e.quality == firstVideo.quality.code)
|
||||
.codecs;
|
||||
if (list == null) {
|
||||
SmartDialog.showToast('当前视频不支持选择解码格式');
|
||||
|
||||
Reference in New Issue
Block a user