From d840ff6a8f965fe52c925c2ee6f0102f7b08a87b Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Wed, 30 Jul 2025 19:51:08 +0300 Subject: [PATCH 1/2] Fix: When changing the player, you also need to call monitorsSetScale() (watch.js) Otherwise, there may be problems with the image if we were viewing using "ZMS MJPEG" and then switched, for example, to the Go2RTC secondary channel and we have different image proportions for "ZMS MJPEG" always using the primary channel and Go2RTC using the secondary channel --- web/skins/classic/views/js/watch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 9110069c19..2c784fd323 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -1334,6 +1334,7 @@ function changePlayer() { setTimeout(function() { streamCmdPlay(true); manageStreamQualityVisibility(); + monitorsSetScale(monitorId); }, 300); /*return; From e7bda622373e1a2d44883aaf96324bdd98d9c108 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 1 Aug 2025 16:59:07 +0300 Subject: [PATCH 2/2] After starting the stream (hiding - showing the page), you need to execute monitorsSetScale() (watch.js) You also need to reset the previous state prevStateStarted, otherwise after the first triggering (document.visibilityState != "hidden") after hiding and then displaying the page, the stream will be restarted within 15 seconds, and this should not happen. --- web/skins/classic/views/js/watch.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 2c784fd323..e8599a66ed 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -1489,8 +1489,10 @@ document.onvisibilitychange = () => { } else { //Start monitor when show page if (monitorStream && prevStateStarted == 'played' && !idleTimeoutTriggered) { + prevStateStarted = false; onPlay(); //Set the correct state of the player buttons. monitorStream.start(monitorStream.currentChannelStream); + monitorsSetScale(monitorId); } } };