From dc1c4e231dcb4c3c08fb2e5ce18d10fa702a7505 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Thu, 25 Jun 2026 18:40:59 +0300 Subject: [PATCH] Play the second channel using Go2RTC on the Console page if it is available (skin.js) --- web/skins/classic/js/skin.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index b4a71d042..6ff290dc4 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -1466,7 +1466,7 @@ function createThumbnailOverlay(img, overlaySrc, dimensions, streamType, monitor } if (isLive && useGo2rtc) { - createGo2rtcStream(container, go2rtcSrc, monitorId || go2rtcMid, fallbackToMjpeg); + createGo2rtcStream(container, img, go2rtcSrc, monitorId || go2rtcMid, fallbackToMjpeg); } else if (streamType === 'rtsp2web') { createRtsp2webStream(container, img, monitorId, fallbackToMjpeg, eventStart, statusBar); } else if (m3u8Exists && currentView !== 'frames') { @@ -1506,15 +1506,16 @@ function formatDateTime(date) { return date.toLocaleString(undefined, options); } -function createGo2rtcStream(container, src, mid, fallbackToMjpeg) { +function createGo2rtcStream(container, img, src, mid, fallbackToMjpeg) { ensureVideoStreamLoaded().then(function() { if (!document.getElementById('thumb-overlay')) return; + const channel = (img.dataset.streamChannel && img.dataset.streamChannel.toLowerCase().indexOf("direct") !== -1 ) ? img.dataset.streamChannel : 'CameraDirectPrimary'; const url = new URL(src); url.protocol = (url.protocol === 'https:') ? 'wss:' : 'ws:'; url.pathname += '/ws'; //url.search = 'src=' + mid + '_0'; - url.search = 'src=' + mid + '_CameraDirectPrimary'; + url.search = 'src=' + mid + '_' + channel; const stream = document.createElement('video-stream'); stream.style.cssText = 'width: 100%; height: 100%; display: block;';