mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-18 11:35:15 -04:00
Fix: Set this.started = false when initializing "MonitorStream" & wsMSE restart stream when error (MonitorStream.js)
Also added: If wsMSE socket error occurs, restart the stream.
This commit is contained in:
@@ -4,6 +4,7 @@ const streaming = [];
|
||||
|
||||
function MonitorStream(monitorData) {
|
||||
this.id = monitorData.id;
|
||||
this.started = false;
|
||||
this.connKey = monitorData.connKey;
|
||||
this.url = monitorData.url;
|
||||
this.url_to_zms = monitorData.url_to_zms;
|
||||
@@ -1225,6 +1226,7 @@ function mseListenerSourceopen(context, videoEl, url) {
|
||||
};
|
||||
context.wsMSE.onerror = function(event) {
|
||||
console.warn(`${dateTimeToISOLocal(new Date())} WebSocket for a video object ID=${context.id} ERROR:`, event);
|
||||
if (this.started) this.restart();
|
||||
};
|
||||
context.wsMSE.onmessage = function(event) {
|
||||
const data = new Uint8Array(event.data);
|
||||
|
||||
Reference in New Issue
Block a user