diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-13 14:42:04 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-13 14:42:04 -0400 |
| commit | b2a5c8c114c15eb9cfc4f072e1bfa084bd3d17ed (patch) | |
| tree | 1e24c128d52b74e70fcab70fe9ba53fd1891db9a /www/js/MonitorModalCtrl.js | |
| parent | e4a4af16734a7b63bf23b27ce0c6041276e6ecc3 (diff) | |
#606 - I think I finally understand DOM render logic
Diffstat (limited to 'www/js/MonitorModalCtrl.js')
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index 887d3328..415812b9 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -10,7 +10,6 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ $scope.isModalActive = true; var intervalModalHandle; var cycleHandle; - var nphTimer; var ld = NVRDataModel.getLogin(); $scope.svgReady = false; $scope.zoneArray = []; @@ -20,6 +19,8 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ var targetID = ""; $scope.imageZoomable = true; $scope.ptzButtonsShown = true; + + @@ -73,11 +74,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ // console.log ("Refreshing Image..."); }.bind(this), 5000); - $timeout.cancel(nphTimer); - nphTimer = $timeout(function () { - $scope.currentStreamMode = 'jpeg'; - NVRDataModel.log("Switching playback via nphzms"); - }, zm.nphSwitchTimer); + // This is the PTZ menu @@ -882,18 +879,6 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ NVRDataModel.log("New image loaded in"); var ld = NVRDataModel.getLogin(); carouselUtils.setStop(false); - if (ld.useNphZms == true) { - $scope.currentStreamMode = 'single'; - NVRDataModel.log("Setting timer to play nph-zms mode"); - // first 5 seconds, load a snapshot, then switch to real FPS display - // this is to avoid initial image load delay - // FIXME: 5 seconds fair? - $timeout.cancel(nphTimer); - nphTimer = $timeout(function () { - $scope.currentStreamMode = 'jpeg'; - NVRDataModel.log("Switching playback via nphzms"); - }, zm.nphSwitchTimer); - } } @@ -1114,6 +1099,33 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ } } + + $scope.constructSingleStream = function() { + var stream; + stream = $scope.monitor.Monitor.streamingURL + + "/nph-zms?mode="+getSingleStreamMode() + + "&monitor="+$scope.monitorId + + "&scale="+$scope.quality + + $rootScope.authSession + + "&rand="+$rootScope.modalRand + + appendSingleStreamConnKey(); + + + return stream; + + + }; + + + function getSingleStreamMode() { + return $scope.isModalStreamPaused ? 'single': 'jpeg'; + } + +function appendSingleStreamConnKey() { + return $scope.isModalStreamPaused ? "": "&connkey="+$scope.connKey; + + }; + //------------------------------------------------------------- //reloaads mon - do we need it? //------------------------------------------------------------- @@ -1171,10 +1183,8 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ $scope.$on('modal.removed', function () { $scope.isModalActive = false; - NVRDataModel.debug("Single monitor exited, killing stream"); - NVRDataModel.killLiveStream($scope.connKey, $scope.controlURL); - - + NVRDataModel.debug("Single monitor exited killing stream"); + NVRDataModel.killLiveStream($scope.connKey, $scope.controlURL); //console.log("**MODAL REMOVED: Stopping modal timer"); $interval.cancel(intervalModalHandle); |
