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;';