From e8defed77b7b1f4d980294b77b46867189a646a3 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 20 Feb 2026 00:27:56 +0300 Subject: [PATCH 1/7] Fix: Fix desync between audioStream.muted and MonitorStream.muted (MonitorStream.js) Due to desynchronization, for example, on the Watch page, after hiding and then re-displaying the page, muted mode spontaneously re-enables after 15 seconds. This is a temporary solution and requires further analysis. --- web/js/MonitorStream.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/js/MonitorStream.js b/web/js/MonitorStream.js index 3a2fe3802..3c010d4d9 100644 --- a/web/js/MonitorStream.js +++ b/web/js/MonitorStream.js @@ -902,6 +902,7 @@ function MonitorStream(monitorData) { // System audio level change const audioStream = el.target; const volumeSlider = this.getVolumeSlider(); + audioStream.muted = this.muted; //Temporarily, I need to figure out why desynchronization occurs when hiding a page and then showing it again, and it spontaneously turns on "muted"... if (volumeSlider) { volumeSlider.setAttribute('data-muted', audioStream.muted); From 2a41b15a5518f08835a53c2080015da91df60914 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 20 Feb 2026 17:19:15 +0300 Subject: [PATCH 2/7] Update video-rtc.js --- web/js/video-rtc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/video-rtc.js b/web/js/video-rtc.js index 5a4688664..6ef472b38 100644 --- a/web/js/video-rtc.js +++ b/web/js/video-rtc.js @@ -318,7 +318,7 @@ export class VideoRTC extends HTMLElement { this.pc = null; } - this.video.src = ''; + this.video.removeAttribute('src'); this.video.srcObject = null; } From e987795a252e506149ce027e550abe260b92a01c Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 20 Feb 2026 17:21:06 +0300 Subject: [PATCH 3/7] Revert MonitorStream.js --- web/js/MonitorStream.js | 1 - 1 file changed, 1 deletion(-) diff --git a/web/js/MonitorStream.js b/web/js/MonitorStream.js index 3c010d4d9..3a2fe3802 100644 --- a/web/js/MonitorStream.js +++ b/web/js/MonitorStream.js @@ -902,7 +902,6 @@ function MonitorStream(monitorData) { // System audio level change const audioStream = el.target; const volumeSlider = this.getVolumeSlider(); - audioStream.muted = this.muted; //Temporarily, I need to figure out why desynchronization occurs when hiding a page and then showing it again, and it spontaneously turns on "muted"... if (volumeSlider) { volumeSlider.setAttribute('data-muted', audioStream.muted); From 8d4f10853a4e1e7f57d00cd491817234880969c3 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 20 Feb 2026 19:20:05 +0300 Subject: [PATCH 4/7] Start playback using a promise (video-rtc.js) This will avoid a warning like `DOMException: The play() request was interrupted by a new load request.` --- web/js/video-rtc.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/web/js/video-rtc.js b/web/js/video-rtc.js index 6ef472b38..19b630c4c 100644 --- a/web/js/video-rtc.js +++ b/web/js/video-rtc.js @@ -158,19 +158,38 @@ export class VideoRTC extends HTMLElement { this.onconnect(); } + /** + * Receiving a playback promise. + */ + promisePlay() { + let promise = this.video.play(); + let error = 'error'; + if (promise !== undefined) { + promise.then(_ => { + error = ''; + }) + .catch(er => { + error = er; + }); + } + return error; + } + /** * Play video. Support automute when autoplay blocked. * https://developer.chrome.com/blog/autoplay/ */ play() { - this.video.play().catch(() => { - if (!this.video.muted) { - this.video.muted = true; - this.video.play().catch(er => { - console.warn(er); - }); - } - }); + let error = this.promisePlay(); + if (error && 'error'.name === 'NotAllowedError') { + if (!this.video.muted) { + this.video.muted = true; + error = promisePlay(); + if (error) { + console.debug("Autoplay error."); + } + } + } } /** From 441e4ec9c1b223cf4a8bd0efdf0b6d7c4cdf752b Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Mon, 23 Feb 2026 16:50:15 +0300 Subject: [PATCH 5/7] Code optimization (video-rtc.js) --- web/js/video-rtc.js | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/web/js/video-rtc.js b/web/js/video-rtc.js index 19b630c4c..2066942fa 100644 --- a/web/js/video-rtc.js +++ b/web/js/video-rtc.js @@ -158,40 +158,22 @@ export class VideoRTC extends HTMLElement { this.onconnect(); } - /** - * Receiving a playback promise. - */ - promisePlay() { - let promise = this.video.play(); - let error = 'error'; - if (promise !== undefined) { - promise.then(_ => { - error = ''; - }) - .catch(er => { - error = er; - }); - } - return error; - } - /** * Play video. Support automute when autoplay blocked. * https://developer.chrome.com/blog/autoplay/ */ play() { - let error = this.promisePlay(); - if (error && 'error'.name === 'NotAllowedError') { - if (!this.video.muted) { + this.video.play().catch(er => { + if (er.name === 'NotAllowedError' && !this.video.muted) { this.video.muted = true; - error = promisePlay(); - if (error) { - console.debug("Autoplay error."); + this.play(); + } else { + console.warn(er); } - } - } + }); } + /** * Send message to server via WebSocket * @param {Object} value From 626d3da9a97a649dbf1f4ba16aa23b6ba8d39231 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Mon, 23 Feb 2026 16:53:24 +0300 Subject: [PATCH 6/7] Fix space (video-rtc.js) --- web/js/video-rtc.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/web/js/video-rtc.js b/web/js/video-rtc.js index 2066942fa..19dbc1753 100644 --- a/web/js/video-rtc.js +++ b/web/js/video-rtc.js @@ -163,17 +163,16 @@ export class VideoRTC extends HTMLElement { * https://developer.chrome.com/blog/autoplay/ */ play() { - this.video.play().catch(er => { - if (er.name === 'NotAllowedError' && !this.video.muted) { - this.video.muted = true; - this.play(); - } else { - console.warn(er); - } - }); + this.video.play().catch(er => { + if (er.name === 'NotAllowedError' && !this.video.muted) { + this.video.muted = true; + this.play(); + } else { + console.warn(er); + } + }); } - /** * Send message to server via WebSocket * @param {Object} value From a14524d0b259d78cb0cdde833de67a62c355c046 Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Mon, 23 Feb 2026 19:11:16 +0300 Subject: [PATCH 7/7] Added an "onplay" event triggered when playback starts (video-rtc.js) --- web/js/video-rtc.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/js/video-rtc.js b/web/js/video-rtc.js index 19dbc1753..6b632aeb1 100644 --- a/web/js/video-rtc.js +++ b/web/js/video-rtc.js @@ -163,7 +163,10 @@ export class VideoRTC extends HTMLElement { * https://developer.chrome.com/blog/autoplay/ */ play() { - this.video.play().catch(er => { + this.video.play().then(_ => { + this.onplay(); + }) + .catch(er => { if (er.name === 'NotAllowedError' && !this.video.muted) { this.video.muted = true; this.play(); @@ -173,6 +176,10 @@ export class VideoRTC extends HTMLElement { }); } + onplay() { + + } + /** * Send message to server via WebSocket * @param {Object} value