mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-13 07:57:29 +08:00
fix: safari resolution get fallback
This commit is contained in:
@@ -310,7 +310,7 @@ function PlayPageClient() {
|
|||||||
case 'SD':
|
case 'SD':
|
||||||
return 20;
|
return 20;
|
||||||
default:
|
default:
|
||||||
return 30;
|
return 0;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
score += qualityScore * 0.4;
|
score += qualityScore * 0.4;
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ const EpisodeSelector: React.FC<EpisodeSelectorProps> = ({
|
|||||||
const sourceKey = `${source.source}-${source.id}`;
|
const sourceKey = `${source.source}-${source.id}`;
|
||||||
const videoInfo = videoInfoMap.get(sourceKey);
|
const videoInfo = videoInfoMap.get(sourceKey);
|
||||||
|
|
||||||
if (videoInfo) {
|
if (videoInfo && videoInfo.quality !== '未知') {
|
||||||
if (videoInfo.hasError) {
|
if (videoInfo.hasError) {
|
||||||
return (
|
return (
|
||||||
<div className='bg-gray-500/10 dark:bg-gray-400/20 text-red-600 dark:text-red-400 px-1.5 py-0 rounded text-xs flex-shrink-0'>
|
<div className='bg-gray-500/10 dark:bg-gray-400/20 text-red-600 dark:text-red-400 px-1.5 py-0 rounded text-xs flex-shrink-0'>
|
||||||
|
|||||||
@@ -72,9 +72,9 @@ export async function getVideoResolutionFromM3u8(m3u8Url: string): Promise<{
|
|||||||
hasMetadataLoaded &&
|
hasMetadataLoaded &&
|
||||||
(hasSpeedCalculated || actualLoadSpeed !== '未知')
|
(hasSpeedCalculated || actualLoadSpeed !== '未知')
|
||||||
) {
|
) {
|
||||||
|
clearTimeout(timeout);
|
||||||
const width = video.videoWidth;
|
const width = video.videoWidth;
|
||||||
if (width && width > 0) {
|
if (width && width > 0) {
|
||||||
clearTimeout(timeout);
|
|
||||||
hls.destroy();
|
hls.destroy();
|
||||||
video.remove();
|
video.remove();
|
||||||
|
|
||||||
@@ -97,6 +97,13 @@ export async function getVideoResolutionFromM3u8(m3u8Url: string): Promise<{
|
|||||||
loadSpeed: actualLoadSpeed,
|
loadSpeed: actualLoadSpeed,
|
||||||
pingTime: Math.round(pingTime),
|
pingTime: Math.round(pingTime),
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// webkit 无法获取尺寸,直接返回
|
||||||
|
resolve({
|
||||||
|
quality: '未知',
|
||||||
|
loadSpeed: actualLoadSpeed,
|
||||||
|
pingTime: Math.round(pingTime),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user