diff --git a/CHANGELOG.md b/CHANGELOG.md index def6f09..f077386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ 格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。 +## 2026-10-26 → v-fixed21 + +- ✨ **切台加载计时**:点击频道后播放器显示「加载中… X.Xs」实时计时(0.1s 精度),线路切换/自动重试期间计时不中断,画面真正播放(playing 事件)才停止并隐藏;解析失败(无线路/全部线路不可用)时计时停止并显示原因 + ## 2026-10-26 → v-fixed20 - ✨ **默认播放改为有声优先**:打开 /live 直接尝试带声播放 TVB 翡翠台;仅当浏览器自动播放策略拦截时才回退静音(画面先动,点画面/点频道立即开声) diff --git a/docker-compose.redis.yml b/docker-compose.redis.yml index d99dab3..2cdc128 100644 --- a/docker-compose.redis.yml +++ b/docker-compose.redis.yml @@ -3,7 +3,7 @@ version: '3.8' services: # KatelyaTV 应用服务 katelyatv: - image: katelyatv:fixed20 + image: katelyatv:fixed21 container_name: katelyatv ports: - "3030:3000" diff --git a/patches/live-inject.js b/patches/live-inject.js index a326af4..dca1f5b 100644 --- a/patches/live-inject.js +++ b/patches/live-inject.js @@ -104,6 +104,11 @@ var v=document.getElementById('v'),tip=document.getElementById('tip'), cur=document.getElementById('cur'),bigplay=document.getElementById('bigplay'); var API='/api/tvbox?live='; function stopAll(){if(hls){hls.destroy();hls=null}if(mp){mp.destroy();mp=null}try{v.removeAttribute('src');v.load()}catch(e){}} +var loadTimer=null; +function startTick(){if(loadTimer)clearInterval(loadTimer);var t0=Date.now(); + tip.style.display='flex';tip.textContent='加载中… 0.0s'; + loadTimer=setInterval(function(){tip.textContent='加载中… '+((Date.now()-t0)/1000).toFixed(1)+'s'},100)} +function stopTick(){if(loadTimer){clearInterval(loadTimer);loadTimer=null}} function playSrc(u,flv){ stopAll(); if(flv&&window.mpegts){try{mp=mpegts.createPlayer({type:'flv',isLive:true,url:u,liveBufferLatencyChasing:true});mp.attachMediaElement(v);mp.load()}catch(e){}} @@ -115,17 +120,16 @@ function playSrc(u,flv){ var pr=v.play(); if(pr&&pr.catch)pr.catch(function(){v.muted=true;var pr2=v.play();if(pr2&&pr2.catch)pr2.catch(function(){bigplay.style.display='flex'})}); setTimeout(function(){if(v.readyState<2&&v.paused)tip.style.display='flex'},2500); - v.onplaying=function(){tip.style.display='none'; + v.onplaying=function(){stopTick();tip.style.display='none'; if(v.muted){tip.textContent='🔇 静音自动播放 · 点击画面开启声音';tip.style.display='flex'; setTimeout(function(){tip.style.display='none'},4000)}}; } bigplay.addEventListener('click',function(){v.muted=false;bigplay.style.display='none';v.play().catch(function(){})}); v.addEventListener('click',function(){if(v.muted){v.muted=false;bigplay.style.display='none'}}); -function nextLine(){if(sel.options.length&&+sel.value