v-fixed20:默认翡翠台有声优先自动播放(策略拦截才回退静音),手动切台必恢复声音

This commit is contained in:
jinghui committed 2026-10-26 11:03:36 +08:00
1 parent 552047ab53
commit 66c77ca267
3 files changed
+8 -3

No files matched your search

+5
View File
@@ -2,6 +2,11 @@
格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。
## 2026-10-26 → v-fixed20
- ✨ **默认播放改为有声优先**:打开 /live 直接尝试带声播放 TVB 翡翠台;仅当浏览器自动播放策略拦截时才回退静音(画面先动,点画面/点频道立即开声)
- 🔧 手动切换频道必定恢复声音(若之前被策略回退成静音)
## 2026-10-26 → v-fixed19
- ✨ **直播页全屏适配**:桌面端播放器铺满视口(频道列表 300px 左栏、播放器占满剩余全部宽高,页面无滚动条),视频 object-fit:contain 自适应;手机端保持频道列表在上、播放器在下的流式布局
+1 -1
View File
@@ -3,7 +3,7 @@ version: '3.8'
services:
# KatelyaTV 应用服务
katelyatv:
image: katelyatv:fixed19
image: katelyatv:fixed20
container_name: katelyatv
ports:
- "3030:3000"
+2 -2
View File
@@ -112,9 +112,8 @@ function playSrc(u,flv){
hls.loadSource(u);hls.attachMedia(v);
hls.on(Hls.Events.ERROR,function(e,d){if(d.fatal){if(d.type===Hls.ErrorTypes.NETWORK_ERROR){hls.startLoad()}else if(d.type===Hls.ErrorTypes.MEDIA_ERROR){hls.recoverMediaError()}else{nextLine()}}})}
}else if(/\\.flv/.test(u)&&window.mpegts){try{mp=mpegts.createPlayer({type:'flv',isLive:true,url:u});mp.attachMediaElement(v);mp.load()}catch(e){}}
v.muted=true;
var pr=v.play();
if(pr&&pr.catch)pr.catch(function(){bigplay.style.display='flex'});
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';
if(v.muted){tip.textContent='🔇 静音自动播放 · 点击画面开启声音';tip.style.display='flex';
@@ -135,6 +134,7 @@ function playLine(p){
window.playLine=playLine;
function pick(id,auto){
curId=id;
if(!auto){v.muted=false;bigplay.style.display='none'}
document.querySelectorAll('.ch.on').forEach(function(e){e.classList.remove('on')});
var el=document.querySelector('.ch[data-id="'+id+'"]');if(el)el.classList.add('on');
sel.innerHTML='';tip.textContent='加载线路…';tip.style.display='flex';