From ebb24a23f46b7154a655aa6079f5cd84f0400c00 Mon Sep 17 00:00:00 2001 From: mtvpls <247332661+mtvpls@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:12:55 +0800 Subject: [PATCH] =?UTF-8?q?source=E7=A7=BB=E9=99=A4=E4=BB=85=E5=AF=B9ios?= =?UTF-8?q?=20Safari=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/play/page.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index b1ef832..5b1cfd8 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -3813,12 +3813,22 @@ function PlayPageClient() { if (!video || !url) return; const sources = Array.from(video.getElementsByTagName('source')); const isHlsJsActive = !!(video as any).hls; + const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : ''; + const isIOSWebKit = + /iPad|iPhone|iPod/i.test(userAgent) || + (/Macintosh/i.test(userAgent) && + typeof navigator !== 'undefined' && + navigator.maxTouchPoints > 1); + const isSafari = + isIOSWebKit || + (/Safari/i.test(userAgent) && + !/Chrome|Chromium|Edg|OPR|Android/i.test(userAgent)); const isHlsLikeSource = /\.m3u8?($|\?)/i.test(url) || url.includes('/api/proxy-m3u8') || url.includes('/api/proxy/vod/m3u8'); - if (isHlsJsActive && isHlsLikeSource) { + if (isSafari && isHlsJsActive && isHlsLikeSource) { // HLS 由 hls.js 接管时,不能再给