Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-18 12:02:54 +08:00
parent 344e2eb29c
commit 4acb4d4879
13 changed files with 25 additions and 280 deletions

View File

@@ -1443,49 +1443,4 @@ class VideoDetailController extends GetxController
),
);
}
@pragma('vm:notify-debugger-on-exception')
Future<void> onCast() async {
SmartDialog.showLoading();
final res = await VideoHttp.tvPlayUrl(
cid: cid.value,
objectId: epId ?? aid,
playurlType: epId != null ? 2 : 1,
qn: currentVideoQa.value?.code,
);
SmartDialog.dismiss();
if (res case Success(:final response)) {
final first = response.durl?.firstOrNull;
if (first == null || first.playUrls.isEmpty) {
SmartDialog.showToast('不支持投屏');
return;
}
final url = VideoUtils.getCdnUrl(first.playUrls);
String? title;
try {
if (isUgc) {
title = Get.find<UgcIntroController>(
tag: heroTag,
).videoDetail.value.title;
} else {
title = Get.find<PgcIntroController>(
tag: heroTag,
).videoDetail.value.title;
}
} catch (_) {}
if (kDebugMode) {
debugPrint(title);
}
Get.toNamed(
'/dlna',
parameters: {
'url': url,
'title': ?title,
},
);
} else {
res.toast();
}
}
}