diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2016-01-15 14:20:37 +0530 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2016-01-15 14:20:37 +0530 |
| commit | bbc2e7deb5cd0a31e49b033fbc534cc6c8611ece (patch) | |
| tree | 6538bb187cd4b672c528f1e3bcb1aee75a587e6a | |
| parent | 73f08ac8d8f4d2995cac1eb5f58e9879c36f305f (diff) | |
#131 - make sure images are not pulled in background mode
Former-commit-id: 115c74770f9023d1acebb0987bd855e2b310fa45
| -rw-r--r-- | www/js/ModalCtrl.js | 14 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 14 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 4 | ||||
| -rw-r--r-- | www/templates/montage.html | 9 |
4 files changed, 34 insertions, 7 deletions
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 8d36d467..aafaa355 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -306,6 +306,20 @@ $scope.togglePresets = function() }; + + //------------------------------------------------------------- + // this is checked to make sure we are not pulling images + // when app is in background. This is a problem with Android, + // for example + //------------------------------------------------------------- + + $scope.isBackground = function() + { + console.log ("Is background called from ModalCtrl and returned " + + ZMDataModel.isBackground()); + return ZMDataModel.isBackground(); + }; + //------------------------------------------------------------- // Send PTZ command to ZM // Note: PTZ fails on desktop, don't bother about it diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index e5f42a00..1cf9efd9 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -290,6 +290,20 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' $state.go("events", {"id": 0}, { reload: true }); } }; + + + //------------------------------------------------------------- + // this is checked to make sure we are not pulling images + // when app is in background. This is a problem with Android, + // for example + //------------------------------------------------------------- + + $scope.isBackground = function() + { + console.log ("Is background called from Montage and returned " + + ZMDataModel.isBackground()); + return ZMDataModel.isBackground(); + }; //------------------------------------------------------------- // Called when user taps on the reorder button diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index 5b7d5670..e5beecfd 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -17,7 +17,7 @@ <div ng-if="$root.authSession!='undefined'"> - <div ng-if="!animationInProgress" > + <div ng-if="!animationInProgress && !isBackground()" > <img style="width:100vw; height:100vh" imageonload="finishedLoadingImage()" image-spinner-loader="lines" @@ -26,7 +26,7 @@ on-swipe-right="onSwipe(monitorId,-1)" /> </div> - <div ng-if="animationInProgress"> + <div ng-if="animationInProgress || isBackground()"> <img style="width:100vw; height:100vh" ng-src="img/pausevideo.png" class="object-fit_contain" diff --git a/www/templates/montage.html b/www/templates/montage.html index ac043ef8..df938f0e 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -33,16 +33,15 @@ </span> <div style="-webkit-column-count:{{slider.monsize}};-webkit-column-gap:0px;line-height:0px;"> - <span ng-repeat="monitor in MontageMonitors|limitTo: monLimit" ng-if="monitor.Monitor.Function!='None' && monitor.Monitor.listDisplay!='noshow' && monitor.Monitor.Enabled !='0'"> + <span ng-repeat="monitor in MontageMonitors|limitTo: monLimit" + ng-if="monitor.Monitor.Function!='None' && monitor.Monitor.listDisplay!='noshow' && monitor.Monitor.Enabled !='0'"> <!-- back to ng-src. spinner was not updating when rand changes--> <!-- moving to single so I can rely on rand for reloads --> <div style="position: relative;width:{{devWidth/slider.monsize}}px;"> <div ng-if="!isModalActive"> - - - <div ng-if="$root.authSession!='undefined'"> + <div ng-if="$root.authSession!='undefined' && !isBackground()"> <div ng-if = "!minimal"> <img id="img-$index" image-spinner-src="{{LoginData.streamingurl}}/nph-zms?mode=single&monitor={{monitor.Monitor.Id}}&scale={{LoginData.montageQuality}}{{$root.authSession}}&rand={{$root.rand}}" ng-click="openModal(monitor.Monitor.Id, monitor.Monitor.Controllable, monitor.Monitor.ControlId)" image-spinner-loader="lines" style=" width: 100% !important; @@ -58,7 +57,7 @@ </div> - <div ng-if="!$root.authSession=='undefined'"> + <div ng-if="!$root.authSession=='undefined' || isBackground()"> <img id="img-$index" ng-src="img/pausevideo.png" style="width: 100% !important; height: auto !important;" /> </div> |
