diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 72c29cf6a..e1d75da0b 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -750,7 +750,7 @@ function initPage() { settingsBtn.prop('disabled', false); } - if (monitorType != 'WebSite') { + if ((monitorType != 'WebSite') && monitorData.length) { monitorStream = new MonitorStream(monitorData[monIdx]); monitorStream.setBottomElement(document.getElementById('dvrControls')); @@ -875,7 +875,7 @@ function initPage() { bindButton('#cyclePrevBtn', 'click', null, cyclePrev); bindButton('#cycleToggle', 'click', null, cycleToggle); bindButton('#cyclePeriod', 'change', null, cyclePeriodChange); - if (cycle) { + if (monitorData.length && cycle) { cycleStart(); } else { cyclePause(); diff --git a/web/skins/classic/views/js/watch.js.php b/web/skins/classic/views/js/watch.js.php index 6556a9d02..a882d5e41 100644 --- a/web/skins/classic/views/js/watch.js.php +++ b/web/skins/classic/views/js/watch.js.php @@ -23,19 +23,18 @@ var showMode = "; var maxDisplayEvents = ; - -var monitorId = Id() ?>; -var monitorWidth = ViewWidth() ?>; -var monitorHeight = ViewHeight() ?>; +var monitorId = 'Id() ?>'; +var monitorWidth = 'ViewWidth() ?>'; +var monitorHeight = 'ViewHeight() ?>'; var monitorUrl = 'UrlToIndex() ?>'; var monitorType = 'Type() ?>'; var monitorRefresh = 'Refresh() ?>'; -var monitorStreamReplayBuffer = StreamReplayBuffer() ?>; +var monitorStreamReplayBuffer = 'StreamReplayBuffer() ?>'; var monitorControllable = Controllable()?'true':'false' ?>; -var monIdx = ; -var nextMid = ""; -var mode = ""; +var monIdx = ''; +var nextMid = ''; +var mode = ''; var monitorData = new Array(); Id(); $monitor_index = 0; + $nextMid = ($monitor_index == count($monitors)-1) ? $monitors[0]->Id() : $monitors[$monitor_index+1]->Id(); } if (!visibleMonitor($mid)) { @@ -86,7 +87,6 @@ if (!visibleMonitor($mid)) { } $monitor = new ZM\Monitor($mid); -$nextMid = ($monitor_index == count($monitors)-1) ? $monitors[0]->Id() : $monitors[$monitor_index+1]->Id(); # cycle is wether to do the countdown/move to next monitor bit. # showCycle is whether to show the cycle controls. @@ -257,6 +257,7 @@ echo htmlSelect('changeRate', $maxfps_options, $options['maxfps']);