fix: "Resolution too big" 채널은 서브스트림이 안 나옴 — 메인 강제 + 서브고정 토글 숨김
앞 커밋(24a24c6)으로 마당(ch5)이 6분할에 다시 뜨는데, 6분할 기본이
서브스트림이라 /ch5_1.264 요청 → NVR이 ch5를 제대로 인제스트 못해서
서브 스트림 자체가 안 나옴(메인 /ch5_0.264는 패스스루 정상).
- chnStreamOverride(): statusText가 "Resolution too big"면 무조건 stream 0(메인)
- 이런 채널엔 "저화질(서브) 고정" 토글 숨김 (눌러도 깨지기만 함)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017yEadXvr9ZWp2S5iRB1B25
This commit is contained in:
@@ -294,7 +294,11 @@ let currentLiveStream=0;
|
||||
// 신호 약한 카메라는 메인이 계속 끊겨서 서브로 고정해두는 용도(2026-07-21).
|
||||
function chnStreamOverride(channelId){
|
||||
const c=lastChannels.find(x=>x.id===channelId);
|
||||
return (c && (c.preferredStream===0||c.preferredStream===1)) ? c.preferredStream : null;
|
||||
if(!c) return null;
|
||||
// NVR이 "Resolution too big"로 물고 있는 채널은 서브스트림(/chN_1.264)이 대개 안 나온다
|
||||
// (메인 패스스루만 됨) → 메인 강제. chnStreamable()로 이미 6분할엔 포함된 상태.
|
||||
if(/resolution too big/i.test(c.statusText||'')) return 0;
|
||||
return (c.preferredStream===0||c.preferredStream===1) ? c.preferredStream : null;
|
||||
}
|
||||
function chnPreferredStream(channelId){ // 라이브 모달용 — 오버라이드 없으면 메인(0)
|
||||
const o=chnStreamOverride(channelId);
|
||||
@@ -495,7 +499,7 @@ async function loadChannels(){
|
||||
${c.preferredStream===1?'<span class="badge warn">저화질 고정</span>':''}
|
||||
</div>
|
||||
<button class="chn-live" data-name="${escHtml(chnDisplayName(c))}" onclick="openLive(${c.id},this)" ${chnStreamable(c)?'':'disabled'}>▶ 라이브</button>
|
||||
<button class="hdr-btn" style="margin-top:6px" onclick="toggleChannelStream(${c.id})">${c.preferredStream===1?'화질 고정 해제':'저화질(서브) 고정'}</button>
|
||||
${/resolution too big/i.test(c.statusText||'')?'':`<button class="hdr-btn" style="margin-top:6px" onclick="toggleChannelStream(${c.id})">${c.preferredStream===1?'화질 고정 해제':'저화질(서브) 고정'}</button>`}
|
||||
${c.standalone?`<button class="hdr-btn" style="margin-top:6px" onclick="toggleExtraCameraRotate(${c.id},${!c.rotate180})">${c.rotate180?'상하반전 해제':'상하반전(180도)'}</button>`:''}
|
||||
</div>`).join('');
|
||||
// 6분할: 스트림 가능한 채널(최대 6, 독립 카메라 포함)로 셀 구성. 빈 칸은 placeholder.
|
||||
|
||||
Reference in New Issue
Block a user