OrbiSubs: master advertises the real resolution and bitrate; players jump to live by hand
The master playlist had BANDWIDTH and RESOLUTION hard-coded to T13's values
(2.6 Mb/s, 1280x720), so ecuadortv (1080p60, ~8 Mb/s) was announced as 720p.
They are now measured from the ingest's own segments in a side thread and the
master is rewritten when they change; --bandwidth/--resolution still pin them.
4f7a685 passed liveMaxLatencyDurationCount alone, which hls.js rejects
("Illegal hls.js config"), so no channel played in player.html or in the
panel's preview. The jump back to live is now done on LEVEL_UPDATED, which
keeps the HOLD-BACK published by the channel as the target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+12
-1
@@ -15,6 +15,13 @@
|
||||
let hls;
|
||||
// ?u=/hls/<canal>/master.m3u8 elige el canal (lo usan los enlaces del panel, tarea 079).
|
||||
const qu=new URLSearchParams(location.search).get('u'); if(qu&&/^\/hls\/[a-z0-9-]+\/master\.m3u8$/.test(qu)) document.getElementById('u').value=qu;
|
||||
// Si quedó más de 6 segmentos detrás del colchón (corte largo de la fuente), al vivo.
|
||||
function saltarAlVivo(h,v){
|
||||
h.on(Hls.Events.LEVEL_UPDATED,(e,d)=>{
|
||||
const td=d.details.targetduration, obj=h.targetLatency, pos=h.liveSyncPosition;
|
||||
if(td&&obj&&pos&&h.latency>obj+6*td) v.currentTime=pos;
|
||||
});
|
||||
}
|
||||
function cargar(){
|
||||
const v=document.getElementById('v'), s=document.getElementById('s');
|
||||
if(hls) hls.destroy();
|
||||
@@ -25,7 +32,11 @@ function cargar(){
|
||||
// (medido en la 081: objetivo 12 s, quedaba en 18): con hasta 1,1x de velocidad converge.
|
||||
// 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});
|
||||
// El salto va a mano (saltarAlVivo): liveMaxLatencyDurationCount solo hace que hls.js tire
|
||||
// "Illegal hls.js config" si no va con liveSyncDurationCount, y ese pisa el HOLD-BACK
|
||||
// (pasó con 4f7a685: ningún canal reproducía, 2026-11-19).
|
||||
hls=new Hls(sync>0?{liveSyncDuration:sync,liveMaxLatencyDuration:sync+12,maxLiveSyncPlaybackRate:1.1}:{maxLiveSyncPlaybackRate:1.1});
|
||||
if(!(sync>0)) saltarAlVivo(hls,v);
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user