From 05aa1cef645327cf4a5c88aaefa373018bed23d4 Mon Sep 17 00:00:00 2001 From: jinghui Date: Mon, 26 Oct 2026 10:35:20 +0800 Subject: [PATCH] =?UTF-8?q?v-fixed17=EF=BC=9A/live=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=92=AD=E6=94=BE=20TVB=20=E7=BF=A1=E7=BF=A0=E5=8F=B0=EF=BC=88?= =?UTF-8?q?=E9=9D=99=E9=9F=B3=E8=87=AA=E5=8A=A8=E6=92=AD+=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=BC=80=E5=A3=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ docker-compose.redis.yml | 2 +- patches/live-inject.js | 24 ++++++++++++++++-------- 缺失 | 1 + 4 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 缺失 diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b6ff5..04eba10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ 格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。 +## 2026-10-26 → v-fixed17 + +- ✨ **打开直播默认播放 TVB 翡翠台**:频道列表加载完自动选中 id=5(找不到则按名字含「翡翠」匹配,再兜底第一个频道)并起播 +- ✨ **静音自动播放**:默认静音自动播(浏览器自动播放策略全绿,画面即开即动);播放后提示「🔇 静音自动播放 · 点击画面开启声音」4 秒;点击画面任意处或中央 ▶ 按钮即开启声音 +- 🔧 自动选台不触发移动端滚动(仅用户手动点频道才滚到播放器) + ## 2026-10-26 → v-fixed16 - 🐛 **修复 `/live` 打开是代码(JSON)**:Next 的 rewrite 到 API 路由时保留原 URL `/live`、静态 query 全丢,导致直播钩子不触发而返回 TVBOX config JSON;改为按 `pathname === "/live"` 识别(实测登录态返回 `text/html`) diff --git a/docker-compose.redis.yml b/docker-compose.redis.yml index 8ff5240..fdbcda8 100644 --- a/docker-compose.redis.yml +++ b/docker-compose.redis.yml @@ -3,7 +3,7 @@ version: '3.8' services: # KatelyaTV 应用服务 katelyatv: - image: katelyatv:fixed16 + image: katelyatv:fixed17 container_name: katelyatv ports: - "3030:3000" diff --git a/patches/live-inject.js b/patches/live-inject.js index d244d49..585c3d6 100644 --- a/patches/live-inject.js +++ b/patches/live-inject.js @@ -69,6 +69,7 @@ body{background:#0f1115;color:#e5e7eb;font-family:-apple-system,BlinkMacSystemFo .player-box{background:#000;border-radius:10px;overflow:hidden;aspect-ratio:16/9;position:relative} video{width:100%;height:100%;display:block;background:#000} .tip{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#6b7280;font-size:14px;pointer-events:none;background:rgba(0,0,0,.35)} +.bigplay{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.45);color:#fff;font-size:64px;cursor:pointer;z-index:5;user-select:none} .bar{display:flex;align-items:center;gap:10px;font-size:13px;color:#9ca3af} .bar .cur{color:#fff;font-weight:600;font-size:15px} select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6px;padding:5px 8px;font-size:13px} @@ -83,7 +84,7 @@ select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6
频道列表 点击切换
加载中…
-
选择频道开始观看
+
选择频道开始观看
▶
未选择
@@ -92,22 +93,27 @@ select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6 var hls=null,mp=null,chs=[],curId=null; var v=document.getElementById('v'),tip=document.getElementById('tip'), grid=document.getElementById('grid'),sel=document.getElementById('lineSel'), - cur=document.getElementById('cur'); + 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){}} 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){}} - else if(/\\.m3u8/.test(u)){ - if(v.canPlayType('application/vnd.apple.mpegurl')){v.src=u} + else if(/\\.m3u8/.test(u)){ if(v.canPlayType('application/vnd.apple.mpegurl')){v.src=u} else if(window.Hls&&Hls.isSupported()){hls=new Hls({maxBufferLength:10,manifestLoadingMaxRetry:2,levelLoadingMaxRetry:2,fragLoadingMaxRetry:3}); 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.play().catch(function(){}); + v.muted=true; + var pr=v.play(); + if(pr&&pr.catch)pr.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(){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=0})||chs[0]; + if(DEF){pick(DEF.id,1)} }).catch(function(){grid.innerHTML='
加载失败,请刷新
'}); `; return new Response(html,{headers:{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}})} diff --git a/缺失 b/缺失 new file mode 100644 index 0000000..e4e3d86 --- /dev/null +++ b/缺失 @@ -0,0 +1 @@ +默认翡翠台逻辑: 1