FIX critical: test Hls.isSupported() FIRST, then native HLS fallback. Chrome reports canPlayType=maybe but actually fails. iPhone Safari uses real native HLS via the new fallback path.
This commit is contained in:
parent
810bed52c2
commit
c198b9d4ea
@ -647,14 +647,10 @@
|
|||||||
try { hls && hls.destroy(); } catch (e) {}
|
try { hls && hls.destroy(); } catch (e) {}
|
||||||
hls = null;
|
hls = null;
|
||||||
|
|
||||||
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
// PRIORITY 1: hls.js (works in Chrome, Firefox, Edge — most browsers)
|
||||||
// iOS Safari — native HLS
|
// We test isSupported() FIRST because some Chrome versions now report
|
||||||
video.src = HLS_URL;
|
// canPlayType('application/vnd.apple.mpegurl') === 'maybe' but native
|
||||||
video.play().catch(() => {});
|
// playback actually fails silently (black screen). hls.js works.
|
||||||
video.addEventListener('playing', hideMsg, { once: true });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.Hls && window.Hls.isSupported()) {
|
if (window.Hls && window.Hls.isSupported()) {
|
||||||
hls = new Hls({
|
hls = new Hls({
|
||||||
liveDurationInfinity: true,
|
liveDurationInfinity: true,
|
||||||
@ -684,6 +680,11 @@
|
|||||||
showMsg('<div class="spinner"></div><div>Verbindung wird wiederhergestellt…</div>');
|
showMsg('<div class="spinner"></div><div>Verbindung wird wiederhergestellt…</div>');
|
||||||
setTimeout(() => { attach(); }, 3000);
|
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 {
|
} else {
|
||||||
showMsg('<div>Stream wird in diesem Browser nicht unterstützt</div>');
|
showMsg('<div>Stream wird in diesem Browser nicht unterstützt</div>');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user