mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-27 19:48:37 +00:00
precheck video dimension
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -166,7 +166,7 @@ class VideoDetailController extends GetxController
|
||||
PlayerStatus? playerStatus;
|
||||
|
||||
late final scrollKey = GlobalKey<ExtendedNestedScrollViewState>();
|
||||
late final RxBool isVertical = false.obs;
|
||||
late final RxBool isVertical;
|
||||
late final RxDouble scrollRatio = 0.0.obs;
|
||||
ScrollController? _scrollCtr;
|
||||
ScrollController get scrollCtr =>
|
||||
@@ -326,6 +326,7 @@ class VideoDetailController extends GetxController
|
||||
pgcType = args['pgcType'];
|
||||
heroTag = args['heroTag'];
|
||||
cover = RxString(args['cover'] ?? '');
|
||||
isVertical = RxBool(args['isVertical'] ?? false);
|
||||
|
||||
sourceType = args['sourceType'] ?? SourceType.normal;
|
||||
isFileSource = sourceType == SourceType.file;
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'package:PiliPlus/models/common/video/source_type.dart';
|
||||
import 'package:PiliPlus/models_new/member_card_info/data.dart';
|
||||
import 'package:PiliPlus/models_new/relation/data.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/dimension.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/section.dart';
|
||||
@@ -485,22 +486,33 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
try {
|
||||
final String bvid = episode.bvid ?? this.bvid;
|
||||
final int aid = episode.aid ?? IdUtils.bv2av(bvid);
|
||||
final int? cid =
|
||||
episode.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
int? cid = episode.cid;
|
||||
Dimension? dimension;
|
||||
if (cid == null) {
|
||||
if (await SearchHttp.ab2cWithDimension(aid: aid, bvid: bvid)
|
||||
case final res?) {
|
||||
cid = res.cid;
|
||||
dimension = res.dimension;
|
||||
}
|
||||
}
|
||||
if (cid == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final String? cover = episode.cover;
|
||||
|
||||
// 重新获取视频资源
|
||||
|
||||
if (videoDetailCtr.isPlayAll) {
|
||||
if (videoDetailCtr.mediaList.indexWhere((item) => item.bvid == bvid) ==
|
||||
-1) {
|
||||
if (dimension == null && episode is EpisodeItem) {
|
||||
dimension = episode.page?.dimension;
|
||||
}
|
||||
PageUtils.toVideoPage(
|
||||
bvid: bvid,
|
||||
cid: cid,
|
||||
cover: cover,
|
||||
dimension: dimension,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user