Added checks when clearing videoStream (MonitorStream.js)

This commit is contained in:
IgorA100 authored and GitHub committed 2026-07-28 13:38:19 +03:00
1 parent e40ef8ecaf
commit 116c4eae8d
1 file changed
+4 -3
+4 -3
View File
@@ -782,10 +782,11 @@ function MonitorStream(monitorData) {
// To avoid memory leaks and race conditions, it's necessary to manipulate the DOM element.
const videoStream = getAVStream(this.id);
if (videoStream) {
videoStream.pause();
// ZMS MJPEG uses <img>, which doesn't implement pause() or load()
videoStream.pause?.();
videoStream.removeAttribute('src');
videoStream.srcObject = null;
videoStream.load();
if ('srcObject' in videoStream) videoStream.srcObject = null;
videoStream.load?.();
}
this.activePlayer = '';
this.started = false;