diff --git a/views/index.ejs b/views/index.ejs index 00f9286..a6885dc 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -647,14 +647,10 @@ try { hls && hls.destroy(); } catch (e) {} hls = null; - if (video.canPlayType('application/vnd.apple.mpegurl')) { - // iOS Safari — native HLS - video.src = HLS_URL; - video.play().catch(() => {}); - video.addEventListener('playing', hideMsg, { once: true }); - return; - } - + // PRIORITY 1: hls.js (works in Chrome, Firefox, Edge — most browsers) + // We test isSupported() FIRST because some Chrome versions now report + // canPlayType('application/vnd.apple.mpegurl') === 'maybe' but native + // playback actually fails silently (black screen). hls.js works. if (window.Hls && window.Hls.isSupported()) { hls = new Hls({ liveDurationInfinity: true, @@ -684,6 +680,11 @@ showMsg('
Verbindung wird wiederhergestellt…
'); setTimeout(() => { attach(); }, 3000); }); + } else if (video.canPlayType('application/vnd.apple.mpegurl')) { + // FALLBACK: iOS Safari native HLS (hls.js not supported on iOS) + video.src = HLS_URL; + video.play().catch(() => {}); + video.addEventListener('playing', hideMsg, { once: true }); } else { showMsg('
Stream wird in diesem Browser nicht unterstützt
'); }