opt: select dialog & feat: select subtitle if muted (#564)

* opt: select dialog

* opt: subtitle

* feat: select subtitle if muted
This commit is contained in:
My-Responsitories
2025-03-29 17:52:06 +08:00
committed by GitHub
parent 2ddfea5cf3
commit 82f9f48a8e
10 changed files with 284 additions and 236 deletions

View File

@@ -45,20 +45,16 @@ class VideoUtils {
String defaultCDNHost = CDNServiceCode.fromCode(defaultCDNService)!.host;
debugPrint("defaultCDNHost:$defaultCDNHost");
if (videoUrl!.contains("szbdyd.com")) {
String hostname =
Uri.parse(videoUrl).queryParameters['xy_usource'] ?? defaultCDNHost;
videoUrl =
Uri.parse(videoUrl).replace(host: hostname, port: 443).toString();
} else if (videoUrl.contains(".mcdn.bilivideo")) {
final uri = Uri.parse(videoUrl);
String hostname = uri.queryParameters['xy_usource'] ?? defaultCDNHost;
videoUrl = uri.replace(host: hostname, port: 443).toString();
} else if (videoUrl.contains(".mcdn.bilivideo") ||
videoUrl.contains("/upgcxcode/")) {
videoUrl = Uri.parse(videoUrl)
.replace(host: defaultCDNHost, port: 443)
.toString();
// videoUrl =
// 'https://proxy-tf-all-ws.bilivideo.com/?url=${Uri.encodeComponent(videoUrl)}';
} else if (videoUrl.contains("/upgcxcode/")) {
videoUrl = Uri.parse(videoUrl)
.replace(host: defaultCDNHost, port: 443)
.toString();
}
debugPrint("videoUrl:$videoUrl");