fix: 홈CCTV 6분할이 online=false 채널을 빈 슬롯 처리 — 마당(ch5)이 안 보임
Xiongmai NVR이 3rd파티 카메라(Mercusys)를 "Resolution too big" + online=false로 계속 보고하는데, 실제로는 RTSP 패스스루가 정상 동작함 (/ch5_0.264 프레임 정상 수신 확인). 그런데 quadChannels 필터가 c.online만 보고 있어서 마당이 6분할에서 빈 슬롯으로 렌더됐음. chnStreamable() = online || "resolution too big" 상태 → 이런 채널도 6분할·라이브 버튼에 포함. 진짜 죽은 채널은 img.onerror가 "영상 없음" 처리. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017yEadXvr9ZWp2S5iRB1B25
This commit is contained in:
1 parent
2b1caf79e3
commit
24a24c6e7f
1 file changed
+8
-3
@@ -413,6 +413,10 @@ function switchTab(t){
|
||||
// 구분하고 싶을 때 편집. 서버 nvr.channelLabels에 채널ID별로 저장(POST로 갱신).
|
||||
let lastChannels=[];
|
||||
function chnDisplayName(c){return c.label||c.model||('채널 '+c.id);}
|
||||
// NVR이 online=false로 보고해도 RTSP 패스스루가 되는 상태가 있다(예: "Resolution too big" —
|
||||
// Xiongmai NVR + 3rd파티 카메라에서 흔함). 이런 채널도 스트림 시도는 하게 한다.
|
||||
// 진짜 죽은 채널이면 각 셀의 img.onerror가 "영상 없음"으로 처리.
|
||||
function chnStreamable(c){return c.online || /resolution too big/i.test(c.statusText||'');}
|
||||
async function editChannelLabel(channelId){
|
||||
const c=lastChannels.find(x=>x.id===channelId);
|
||||
const val=prompt('채널 #'+channelId+' 이름/위치 (비워두면 모델명 표시)',c?c.label||'':'');
|
||||
@@ -490,12 +494,13 @@ async function loadChannels(){
|
||||
${c.faceEvent?'<span class="badge warn">얼굴 감지</span>':''}
|
||||
${c.preferredStream===1?'<span class="badge warn">저화질 고정</span>':''}
|
||||
</div>
|
||||
<button class="chn-live" data-name="${escHtml(chnDisplayName(c))}" onclick="openLive(${c.id},this)" ${c.online?'':'disabled'}>▶ 라이브</button>
|
||||
<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>
|
||||
${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.
|
||||
quadChannels=channels.filter(c=>c.online).slice(0,6);
|
||||
// 6분할: 스트림 가능한 채널(최대 6, 독립 카메라 포함)로 셀 구성. 빈 칸은 placeholder.
|
||||
// online=false여도 패스스루 되는 상태("Resolution too big" 등)는 포함 — chnStreamable() 참고.
|
||||
quadChannels=channels.filter(chnStreamable).slice(0,6);
|
||||
renderQuad();
|
||||
}
|
||||
async function addExtraCamera(){
|
||||
|
||||
Reference in new issue
Block a user