summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-04-18 10:42:28 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-04-18 10:42:28 -0400
commit14810e783f49d7bd01e7c66d841fc663bde414aa (patch)
tree1d1f6d10d1e8dab2e8bf7afb69a9b50717a98b6e /www
parent36e20e38dd557381ad4a42cdc1053cc2d7e92cd9 (diff)
#606 montage history cleanups and url cleanups
Diffstat (limited to 'www')
-rw-r--r--www/js/MontageHistoryCtrl.js43
1 files changed, 36 insertions, 7 deletions
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js
index 235e0c11..acf02d1b 100644
--- a/www/js/MontageHistoryCtrl.js
+++ b/www/js/MontageHistoryCtrl.js
@@ -7,7 +7,9 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
{
var broadcastHandles = [];
var isSimulStreaming = false;
+ $scope.isSimulStreaming = isSimulStreaming;
var areStreamsStopped = false;
+ var viewCleaned = false;
//--------------------------------------------------------------------------------------
// Handles bandwidth change, if required
//
@@ -895,10 +897,33 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
function onPause()
{
NVRDataModel.debug("MontageHistoryCtrl: onpause called");
- $interval.cancel($rootScope.eventQueryInterval);
- $interval.cancel(intervalHandle);
- // $interval.cancel(modalIntervalHandle);
- // FIXME: Do I need to setAwake(false) here?
+ viewCleanup();
+ viewCleaned = true;
+ }
+
+ function viewCleanup() {
+
+ if (viewCleaned) {
+ NVRDataModel.debug("Montage History View Cleanup was already done, skipping");
+ return;
+ }
+ $interval.cancel(eventQueryHandle);
+ if (pckry) pckry.destroy();
+
+
+ broadcastHandles = [];
+
+ areStreamsStopped = true;
+
+ $timeout(function () {
+
+ NVRDataModel.debug("Killing all streams in montage to save memory/nw...");
+ for (i = 0; i < $scope.MontageMonitors.length; i++) {
+ if ($scope.MontageMonitors[i].Monitor.listDisplay == 'show') NVRDataModel.killLiveStream($scope.MontageMonitors[i].Monitor.connKey, $scope.MontageMonitors[i].Monitor.controlURL);
+
+ }
+
+ });
}
function onResume()
@@ -939,7 +964,10 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
$scope.$on('$ionicView.beforeLeave', function()
{
//console.log("**VIEW ** Event History Ctrl Left, force removing modal");
-
+ areStreamsStopped = true;
+ viewCleanup();
+ viewCleaned = true;
+
// if ($scope.modal) $scope.modal.remove();
NVRDataModel.log("Cancelling event query timer");
@@ -1206,6 +1234,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
isSimulStreaming = false;
NVRDataModel.log ("IOS detected, disabling simulstreaming");
}
+ $scope.isSimulStreaming = isSimulStreaming;
areStreamsStopped = true;
NVRDataModel.regenConnKeys();
@@ -1374,8 +1403,8 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
stream = monitor.Monitor.eventUrl +
$rootScope.authSession +
appendConnKey(monitor.Monitor.connKey);
- console.log (JSON.stringify(monitor));
- console.log("STREAM=" + stream);
+ //console.log (JSON.stringify(monitor));
+ //console.log("STREAM=" + stream);
return stream;
};