summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-02-22 13:35:43 -0500
committerpliablepixels <pliablepixels@gmail.com>2016-02-22 13:35:43 -0500
commit36568036d2493f13272b2a8d9c47c2674b7031c2 (patch)
tree6746c55c4fffaa301883a875424de5b29e9e057c
parent9709cb1427bb366893b2f5f6cf73236ff13a76e2 (diff)
#164 - hopefully final fixes
Former-commit-id: 3c2522a64e0b89b4e7a032061b968a9700b36f36
-rw-r--r--www/js/EventModalCtrl.js55
-rw-r--r--www/templates/events-modal.html2
2 files changed, 38 insertions, 19 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index 4f62f614..651b5c36 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -94,8 +94,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
window.stop();
$scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString();
$timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500);
- $timeout.cancel(eventQueryHandle);
- eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ //$timeout.cancel(eventQueryHandle);
+ //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
@@ -125,7 +125,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
function checkEvent()
{
- console.log ("Event timer");
+ //console.log ("Event timer");
+ //console.log ("Event timer");
processEvent('99',$scope.connKey);
}
@@ -222,7 +223,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
});
req.success (function (resp) {
- ZMDataModel.zmDebug ("processEvent success:"+JSON.stringify(resp));
+ // ZMDataModel.zmDebug ("processEvent success:"+JSON.stringify(resp));
if (resp.result=="Ok")
{
@@ -241,9 +242,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
//if (Math.floor(resp.status.progress) >=$scope.currentEventDuration)
- console.log ("all good, scheduling next iteration after " + zm.eventPlaybackQuery);
+
//$timeout (checkEvent(), zm.eventPlaybackQuery);
- eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
}
else // resp.result was messed up
@@ -254,14 +255,14 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
$scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString();
$timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500);
ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey);
- eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
}
});
req.error (function (resp) {
ZMDataModel.zmDebug ("processEvent error:"+JSON.stringify(resp));
- eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
});
@@ -373,7 +374,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
then (function (resp)
{
$ionicLoading.hide();
- console.log ("PAUSE ANSWER IS " + JSON.stringify(resp));
+ // console.log ("PAUSE ANSWER IS " + JSON.stringify(resp));
$scope.currentProgress = resp.data.status.progress;
// console.log ("STEP 0 progress is " + $scope.currentProgress);
$scope.slides = [];
@@ -650,13 +651,14 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
if (ld.useNphZmsForEvents)
{
- ZMDataModel.zmLog ("Starting checkAllEvents timer");
+ ZMDataModel.zmLog ("Starting checkAllEvents interval...");
- eventQueryHandle = $timeout (checkEvent(), zm.eventPlaybackQuery);
- /*eventQueryHandle = $interval(function () {
+ //eventQueryHandle = $timeout (checkEvent(), zm.eventPlaybackQuery);
+ $interval.cancel(eventQueryHandle);
+ eventQueryHandle = $interval(function () {
checkEvent();
// console.log ("Refreshing Image...");
- }.bind(this),zm.eventPlaybackQuery);*/
+ }.bind(this),zm.eventPlaybackQuery);
}
}
@@ -671,9 +673,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
$scope.$on('modal.removed', function () {
$scope.isModalActive = false;
+ window.stop();
//console.log("**MODAL REMOVED: Stopping modal timer");
- //$interval.cancel(eventQueryHandle);
- $timeout.cancel(eventQueryHandle);
+ $interval.cancel(eventQueryHandle);
+ //$timeout.cancel(eventQueryHandle);
ZMDataModel.zmDebug ("Modal removed - killing connkey");
sendCommand(17,$scope.connKey);
@@ -778,8 +781,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
window.stop();
$scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString();
$timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500);
- $timeout.cancel(eventQueryHandle);
- eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ //$timeout.cancel(eventQueryHandle);
+ //eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
};
@@ -955,7 +958,23 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
});
sendCommand ( cmd,connkey)
- .then (function (success) {$ionicLoading.hide();}, function (error) {$ionicLoading.hide();});
+ .then (
+ function (success)
+ {
+ //console.log ("jump success " + JSON.stringify(success));
+ $ionicLoading.hide();
+ },
+ function (error) {
+
+ ZMDataModel.zmDebug("Hmm jump error " + JSON.stringify(error));
+ window.stop();
+ $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString();
+ $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500);
+ ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey);
+ //$timeout.cancel(eventQueryHandle);
+ // eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery);
+ $ionicLoading.hide();
+ });
var slidein;
var slideout;
if (dirn == 1) {
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index 5a7991f8..a2b1c1e3 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -43,7 +43,7 @@
<!--<div style="color:white">connkey:{{connKey}}</div>-->
<div style="width:100vw; height:100vh" >
- <img ng-click="togglePause()" image-spinner-src="{{loginData.streamingurl}}/nph-zms?source=event&mode=jpeg&event={{eventId}}&frame=1&replay={{currentStreamMode}}&rate=100&connkey={{connKey}}&scale={{singleImageQuality}}{{$root.authSession}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"/>
+ <img image-spinner-src="{{loginData.streamingurl}}/nph-zms?source=event&mode=jpeg&event={{eventId}}&frame=1&replay={{currentStreamMode}}&rate=100&connkey={{connKey}}&scale={{singleImageQuality}}{{$root.authSession}}" ng-class="{'object-fit_cover':imageFit==false, 'object-fit_contain':imageFit==true}"/>
<div ng-if="isPaused" style="position:absolute; top:50%; left:50%;white-space:nowrap;overflow:hidden;z-index:999"
class="header-paused">