diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-06-11 19:42:58 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-06-11 19:42:58 -0400 |
| commit | 95e1dac3fee48321e0d53769e430fe5f5f01408f (patch) | |
| tree | f2a90ceac0795bd70b31a1fde5026ead27fba345 /www/js | |
| parent | dea409685ffb8f9476e44b4203c147e4a7a987a0 (diff) | |
#647 on pause - force quit if multi streaming is on
Diffstat (limited to 'www/js')
| -rwxr-xr-x | www/js/DataModel.js | 4 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 8 | ||||
| -rwxr-xr-x | www/js/app.js | 20 |
3 files changed, 25 insertions, 7 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 48929107..ad0ab6e1 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -619,6 +619,10 @@ angular.module('zmApp.controllers') return (currentServerMultiPortSupported); }, + isMultiPortDisabled: function () { + return loginData.disableSimulStreaming; + }, + getCurrentServerVersion: function () { return (currentServerVersion); }, diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 2a8be064..1f29a253 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1308,7 +1308,7 @@ angular.module('zmApp.controllers') function viewCleanup() { - + currentStreamState = streamState.STOPPED; if (viewCleaned) { NVRDataModel.debug("Montage View Cleanup was already done, skipping"); return; @@ -1322,7 +1322,7 @@ angular.module('zmApp.controllers') broadcastHandles = []; - currentStreamState = streamState.STOPPED; + $timeout(function () { if (!$scope.singleMonitorModalOpen && simulStreaming) { NVRDataModel.debug("Killing all streams in montage to save memory/nw..."); @@ -1711,7 +1711,7 @@ angular.module('zmApp.controllers') var stream; if (currentStreamState == streamState.STOPPED || monitor.Monitor.listDisplay == 'noshow' || $rootScope.authSession == 'undefined') { - //console.log ("STREAM=empty and auth="+$rootScope.authSession); + // console.log ("STREAM=empty and auth="+$rootScope.authSession); return ""; } @@ -1733,7 +1733,7 @@ angular.module('zmApp.controllers') //"&rand="+$scope.randToAvoidCacheMem + - //console.log("STREAM=" + stream); + // console.log("STREAM=" + stream); return stream; }; diff --git a/www/js/app.js b/www/js/app.js index 2343b72b..f5be3d1e 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -1943,8 +1943,7 @@ angular.module('zmApp', [ $interval.cancel($rootScope.eventQueryInterval); $interval.cancel($rootScope.intervalHandle); zmAutoLogin.stop(); - if ($rootScope.zmPopup) - $rootScope.zmPopup.close(); + // NVRDataModel.log("ROOT APP: Stopping network "); @@ -1960,10 +1959,25 @@ angular.module('zmApp', [ if (ld.exitOnSleep && $rootScope.platformOS == "android") { NVRDataModel.log("user exited app"); - window.stop(); + navigator.app.exitApp(); + // ionic.Platform.exitApp(); } + if (NVRDataModel.getCurrentServerMultiPortSupported() && $rootScope.platformOS == "android" && !NVRDataModel.isMultiPortDisabled()) { + NVRDataModel.log ("Multiport is active, killing app to make sure no streams continue in background..."); + navigator.app.exitApp(); + } else { + NVRDataModel.debug ("Not exiting app because:"); + NVRDataModel.debug ("getCurrentServerMultiPortSupported:"+NVRDataModel.getCurrentServerMultiPortSupported()); + NVRDataModel.debug ("platform:"+$rootScope.platformOS); + NVRDataModel.debug ("isMultiPortDisabled:"+NVRDataModel.isMultiPortDisabled()); + + } + + if ($rootScope.zmPopup) + $rootScope.zmPopup.close(); + }, false); } |
