diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index da7e02d..0bbcf4c 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -310,7 +310,7 @@ function PlayPageClient() { case 'SD': return 20; default: - return 30; + return 0; } })(); score += qualityScore * 0.4; diff --git a/src/components/EpisodeSelector.tsx b/src/components/EpisodeSelector.tsx index 58cbb9c..719aa10 100644 --- a/src/components/EpisodeSelector.tsx +++ b/src/components/EpisodeSelector.tsx @@ -476,7 +476,7 @@ const EpisodeSelector: React.FC = ({ const sourceKey = `${source.source}-${source.id}`; const videoInfo = videoInfoMap.get(sourceKey); - if (videoInfo) { + if (videoInfo && videoInfo.quality !== '未知') { if (videoInfo.hasError) { return (
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index a72c9fe..5c7b3a6 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -72,9 +72,9 @@ export async function getVideoResolutionFromM3u8(m3u8Url: string): Promise<{ hasMetadataLoaded && (hasSpeedCalculated || actualLoadSpeed !== '未知') ) { + clearTimeout(timeout); const width = video.videoWidth; if (width && width > 0) { - clearTimeout(timeout); hls.destroy(); video.remove(); @@ -97,6 +97,13 @@ export async function getVideoResolutionFromM3u8(m3u8Url: string): Promise<{ loadSpeed: actualLoadSpeed, pingTime: Math.round(pingTime), }); + } else { + // webkit 无法获取尺寸,直接返回 + resolve({ + quality: '未知', + loadSpeed: actualLoadSpeed, + pingTime: Math.round(pingTime), + }); } } };