fix get video part dimension

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-05 10:39:24 +08:00
parent 31aeab3516
commit d0373da5ca

View File

@@ -248,13 +248,15 @@ class VideoDetailController extends GetxController
if (width == null || height == null) { if (width == null || height == null) {
if (isUgc && !isFileSource) { if (isUgc && !isFileSource) {
final ugcIntroCtr = Get.find<UgcIntroController>(tag: heroTag); final ugcIntroCtr = Get.find<UgcIntroController>(tag: heroTag);
final data = ugcIntroCtr.videoDetail.value; final cid = this.cid.value;
if (data.cid == cid.value) { final part = ugcIntroCtr.videoDetail.value.pages?.firstWhereOrNull(
final dimension = data.dimension!; (e) => e.cid == cid,
);
if (part != null) {
final dimension = part.dimension!;
width = dimension.width!; width = dimension.width!;
height = dimension.height!; height = dimension.height!;
} else { } else {
ugcIntroCtr.queryVideoIntro().whenComplete(_setVideoHeight);
return; return;
} }
} else { } else {