summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/EventServer.js13
-rw-r--r--www/js/MontageCtrl.js17
-rw-r--r--www/js/MontageHistoryCtrl.js8
-rw-r--r--www/lang/locale-en.json2
4 files changed, 27 insertions, 13 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js
index ceef3629..5254bde3 100644
--- a/www/js/EventServer.js
+++ b/www/js/EventServer.js
@@ -16,9 +16,9 @@ angular.module('zmApp.controllers')
var ws;
var localNotificationId = 0;
- var firstError = true;
var pushInited = false;
var isTimerOn = false;
+ var initCalled = false;
//--------------------------------------------------------------------------
@@ -135,6 +135,7 @@ angular.module('zmApp.controllers')
ws = $websocket(loginData.eventServer,{reconnectIfNotNormalClose: false});
ws.onOpen(openHandshake);
+ initCalled = true;
// Transmit auth information to server
// ws.$on('$open', openHandshake);
@@ -146,12 +147,20 @@ angular.module('zmApp.controllers')
// we don't need this check as I changed reconnect interval to 60s
//if ((Date.now() - lastEventServerCheck > 30000.0) || firstError)
+
+
NVRDataModel.debug("Websocket Errorhandler called");
+
+ if (!initCalled) {
+ NVRDataModel.log ("Ignoring websocket error as init not yet called");
+ return;
+ }
+
$timeout(function()
{
NVRDataModel.displayBanner('error', ['Event Server connection error']);
}, 3000); // leave 3 seconds for transitions
- firstError = false;
+
lastEventServerCheck = Date.now();
if (typeof ws !== 'undefined'){
NVRDataModel.debug ("-->Forcing socket close");
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index bac79b9f..f8fda110 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -6,7 +6,7 @@
/* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded, ConnectSDK, moment */
angular.module('zmApp.controllers')
-.controller('zmApp.MontageCtrl', ['$scope', '$rootScope', 'NVRDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', '$localstorage', '$translate', 'SecuredPopups', function($scope, $rootScope, NVRDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window, $localstorage, $translate, SecuredPopups)
+.controller('zmApp.MontageCtrl', ['$scope', '$rootScope', 'NVRDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', '$localstorage', '$translate', 'SecuredPopups', 'EventServer', function($scope, $rootScope, NVRDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window, $localstorage, $translate, SecuredPopups, EventServer)
{
//---------------------------------------------------------------------
@@ -30,13 +30,20 @@ angular.module('zmApp.controllers')
var reloadPage = zm.forceMontageReloadDelay;
//var reloadPage = 30;
- var simulStreaming = 0; // will be 1 if you are on iOS or have multiport
+ var simulStreaming = 0; // will be 1 if you multiport
$rootScope.$on("auth-success", function () {
- NVRDataModel.debug("REAUTH");
+ NVRDataModel.debug("Montage Re-auth handler; stopping network...");
//console.log ("RETAUTH");
NVRDataModel.stopNetwork();
+
+ if (NVRDataModel.getLogin().isUseEventServer) {
+ NVRDataModel.debug ("Restablishing event server connection...");
+ EventServer.disconnect();
+ EventServer.init();
+ }
+
});
@@ -1710,11 +1717,11 @@ angular.module('zmApp.controllers')
//console.log ("****** MULTIPORT="+multiPortZms);
NVRDataModel.debug ("Multiport="+data);
- if ($rootScope.platformOS == 'ios') {
+ /* if ($rootScope.platformOS == 'ios') {
simulStreaming = '1';
NVRDataModel.debug ("IOS detected, force enabling simulStreams");
}
-
+*/
if (ld.disableSimulStreaming) {
simulStreaming = '0';
NVRDataModel.debug ("Forcing simulStreams off as you have disabled it");
diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js
index 111073f0..6c8c3cf2 100644
--- a/www/js/MontageHistoryCtrl.js
+++ b/www/js/MontageHistoryCtrl.js
@@ -900,7 +900,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
});*/
$scope.$on('$ionicView.beforeEnter', function()
{
- $scope.isSimulStreaming = ($rootScope.platformOS == 'ios') ? true: NVRDataModel.getCurrentServerMultiPortSupported();
+ $scope.isSimulStreaming = NVRDataModel.getCurrentServerMultiPortSupported();
NVRDataModel.regenConnKeys();
// NVRDataModel.log ("Before Enter History: initing connkeys");
@@ -1431,13 +1431,11 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc
if (!$scope.isSimulStreaming)
{
- NVRDataModel.log("Limiting montage to 5, thanks to Chrome's stupid connection limit");
+ NVRDataModel.log("Limiting montage to 5, thanks to max connection per domain limit");
$scope.currentLimit = 5;
$scope.monLimit = 5;
}
- else {
- NVRDataModel.debug ("Since Multiport is supported, or you are on iOS, taking off Chrome limit!");
- }
+
$rootScope.authSession = "undefined";
$ionicLoading.show(
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index ea6c82e7..d49aa5a2 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -37,7 +37,7 @@
"kChangeSettingsFor" :"Change settings for",
"kChangeState" :"Change State",
"kCheckCredentials" :"Please check your credentials",
- "kChromeMax" :"max of 5 monitors - chrome limit",
+ "kChromeMax" :"max of 5 monitors - browser limit",
"kCleaningUp" :"cleaning up",
"kClear" :"Clear",
"kCollapse" :"collapse",