mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-03 07:55:22 -04:00
Added checks when clearing videoStream (MonitorStream.js)
This commit is contained in:
1 parent
e40ef8ecaf
commit
116c4eae8d
1 file changed
+4
-3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user