From 4f7a6855712e1bdbf09396b64a7f0cb51a00d727 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 17 Nov 2026 14:49:13 -0300 Subject: [PATCH] OrbiSubs players: jump back to live when more than 6 segments behind (after a source outage) --- panel/src/public/app.js | 3 ++- web/player.html | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/panel/src/public/app.js b/panel/src/public/app.js index 0fd25a3..e0cc963 100644 --- a/panel/src/public/app.js +++ b/panel/src/public/app.js @@ -472,7 +472,8 @@ function openView(c) { // Colchón al borde: el HOLD-BACK de video.m3u8 (lo fija el canal, tarea 081); sin él, // los 3 segmentos de hls.js, que es lo que usaba la 076 para que el inglés llegue a tiempo. // Con hasta 1,1x de velocidad llega al objetivo (hls.js arranca más atrás del HOLD-BACK). - hls = new Hls({ maxLiveSyncPlaybackRate: 1.1 }); + // Con más de 6 segmentos de atraso (después de un corte de la fuente) salta al vivo (083). + hls = new Hls({ maxLiveSyncPlaybackRate: 1.1, liveMaxLatencyDurationCount: 6 }); hls.on(Hls.Events.ERROR, (ev, d) => { if (!d.fatal) return; if (d.type === Hls.ErrorTypes.MEDIA_ERROR) hls.recoverMediaError(); else hls.startLoad(); }); hls.loadSource(src); hls.attachMedia(v); hls.on(Hls.Events.SUBTITLE_TRACKS_UPDATED, () => { diff --git a/web/player.html b/web/player.html index c67a9c7..c4a1514 100644 --- a/web/player.html +++ b/web/player.html @@ -23,7 +23,9 @@ function cargar(){ const sync=+new URLSearchParams(location.search).get('sync'); // hls.js toma el HOLD-BACK como objetivo pero arranca más atrás y no se acerca solo // (medido en la 081: objetivo 12 s, quedaba en 18): con hasta 1,1x de velocidad converge. - hls=new Hls(sync>0?{liveSyncDuration:sync,liveMaxLatencyDuration:sync+12,maxLiveSyncPlaybackRate:1.1}:{maxLiveSyncPlaybackRate:1.1}); + // Tras un corte largo de la fuente (CDN de T13, 65 s el 2026-11-17 17:37) el player quedaba + // un minuto atrás y a 1,1x tardaba ~10 min en volver: con más de 6 segmentos de atraso salta al vivo. + hls=new Hls(sync>0?{liveSyncDuration:sync,liveMaxLatencyDuration:sync+12,maxLiveSyncPlaybackRate:1.1}:{maxLiveSyncPlaybackRate:1.1,liveMaxLatencyDurationCount:6}); // Recuperación estándar de hls.js: el CDN de origen mete cortes de PTS en las tandas // y el decoder del navegador a veces se cae ahí (visto con Chromium, 2026-11-16). hls.on(Hls.Events.ERROR,(e,d)=>{ if(!d.fatal) return;