OrbiSubs players: jump back to live when more than 6 segments behind (after a source outage)

This commit is contained in:
guy
2026-11-17 14:49:13 -03:00
parent 02bce44857
commit 4f7a685571
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -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;