diff --git a/public/app.js b/public/app.js index 1b0fb8e..4c4b706 100644 --- a/public/app.js +++ b/public/app.js @@ -206,10 +206,20 @@ async function playChannel(key) { // Safari / native HLS video.src = hlsUrl; } + // Belt-and-suspenders loop: native `loop` attribute + explicit handler + // (Shaka sometimes pauses on `ended` instead of looping the manifest) + video.loop = true; + video.addEventListener('ended', () => { + try { + video.currentTime = 0; + video.play().catch(() => {}); + } catch (_) {} + }); video.play().catch(() => { /* autoplay may be blocked, user can press play */ }); } catch (e) { console.warn('HLS load failed, falling back to native src:', e?.message); video.src = hlsUrl; + video.loop = true; video.play().catch(() => {}); }