Play the second channel using Go2RTC on the Console page if it is available (skin.js)

This commit is contained in:
IgorA100 authored and GitHub committed 2026-06-25 18:40:59 +03:00
1 parent 7cf71f82b2
commit dc1c4e231d
1 file changed
+4 -3
+4 -3
View File
@@ -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;';