diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-21 16:13:48 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-04-21 16:13:48 -0400 |
| commit | 159c64886c10a25565353016f6190eb1f36259fb (patch) | |
| tree | c77ec2ccef7299b5cb0e51cff0ffa93dacba5ff4 /www/js/EventModalCtrl.js | |
| parent | aec88217f55948fdb0da242c42ace38b93e511e9 (diff) | |
#614 clumsy integration of swipe and tap - need to do better
Diffstat (limited to 'www/js/EventModalCtrl.js')
| -rw-r--r-- | www/js/EventModalCtrl.js | 159 |
1 files changed, 77 insertions, 82 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 984f5742..46fda660 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1388,74 +1388,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro return; } - if ($scope.liveFeedMid) return; - var ld = NVRDataModel.getLogin(); - if (!ld.canSwipeMonitors) return; - - if ($state.current.name=="app.moment") { - // console.log ("Searching for eid:"+eventId); - var i; - for (i=0; i < $scope.moments.length;i++) { - if ($scope.moments[i].Event.Id == eventId) break; - } - // console.log ("Event found at index:"+i); - if (dirn == -1 && i > 0) i--; - if (dirn == 1 && i < $scope.moments.length -1) i++; - NVRDataModel.debug ("Next is index:"+i+" maxScoreId:"+$scope.moments[i].Event.MaxScoreFrameId); - maxAlarmFid = $scope.moments[i].Event.MaxScoreFrameId; - eventId = $scope.moments[i].Event.Id; - } - - if (currentStreamState == streamState.ACTIVE) { - // NVRDataModel.log("using zms to move "); - - if ($scope.defaultVideo == '' || $scope.defaultVideo == 'undefined') { - // need to kill zms - currentStreamState = streamState.STOPPED; - $timeout (function() { - NVRDataModel.killLiveStream($scope.connKey); - - }); - - } - - if ($scope.defaultVideo != "" && $scope.defaultVideo != 'undefined') { - - if (handle){ - - NVRDataModel.debug ("Clearing video feed..."); - handle.stop(); - handle.clearMedia(); - - - } - - + //if ($scope.liveFeedMid) return; - playerReady = false; - $scope.defaultVideo = ""; - $scope.video_url=""; - $scope.videoObject = {}; - $scope.videoIsReady = false; - - } - - - - if (dirn==1) { - NVRDataModel.debug ("Moving to:"+$scope.nextId) ; - prepareModalEvent($scope.nextId); - } - else if (dirn==-1 && $scope.prevId > 0) { - NVRDataModel.debug ("Moving to:"+$scope.prevId) ; - prepareModalEvent($scope.prevId); - } - - // jumpToEventZms($scope.connKey, dirn); - } - - - + jumpToEvent(eid,dirn); /* else { jumpToEvent(eid, dirn); @@ -1467,20 +1402,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.jumpToEvent = function(eid, dirn) { - // console.log("jumptoevent"); - var ld = NVRDataModel.getLogin(); - if (ld.useNphZmsForEvents) - { - NVRDataModel.log("using zms to move "); - jumpToEventZms($scope.connKey, dirn); - // sendCommand ( dirn==1?'13':'12',$scope.connKey); - - } - else - { - jumpToEvent(eid, dirn); - } - + jumpToEvent (eid,dirn); }; function jumpToEvent(eid, dirn) @@ -1526,7 +1448,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro element.removeClass(slideout); element.addClass(slidein) .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', inWithNew); - prepareModalEvent(eid); + processMove(eid,dirn); }, 200); } @@ -1535,10 +1457,83 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro element.removeClass(slidein); $scope.animationInProgress = false; carouselUtils.setStop(false); + + + } } + function processMove(eid,dirn) { + var ld = NVRDataModel.getLogin(); + if (!ld.canSwipeMonitors) return; + + if ($state.current.name=="app.moment") { + // console.log ("Searching for eid:"+eventId); + var i; + for (i=0; i < $scope.moments.length;i++) { + if ($scope.moments[i].Event.Id == eventId) break; + } + // console.log ("Event found at index:"+i); + if (dirn == -1 && i > 0) i--; + if (dirn == 1 && i < $scope.moments.length -1) i++; + NVRDataModel.debug ("Next is index:"+i+" maxScoreId:"+$scope.moments[i].Event.MaxScoreFrameId); + maxAlarmFid = $scope.moments[i].Event.MaxScoreFrameId; + eventId = $scope.moments[i].Event.Id; + } + + if (currentStreamState == streamState.ACTIVE) { + // NVRDataModel.log("using zms to move "); + + if ($scope.defaultVideo == '' || $scope.defaultVideo == 'undefined') { + // need to kill zms + currentStreamState = streamState.STOPPED; + $timeout (function() { + NVRDataModel.killLiveStream($scope.connKey); + + }); + + } + + if ($scope.defaultVideo != "" && $scope.defaultVideo != 'undefined') { + + if (handle){ + + NVRDataModel.debug ("Clearing video feed..."); + handle.stop(); + handle.clearMedia(); + + + } + + + + playerReady = false; + $scope.defaultVideo = ""; + $scope.video_url=""; + $scope.videoObject = {}; + $scope.videoIsReady = false; + + } + + + + if (dirn==1) { + NVRDataModel.debug ("Moving to:"+$scope.nextId) ; + prepareModalEvent($scope.nextId); + } + else if (dirn==-1 && $scope.prevId > 0) { + NVRDataModel.debug ("Moving to:"+$scope.prevId) ; + prepareModalEvent($scope.prevId); + } + + // jumpToEventZms($scope.connKey, dirn); + } + + + + } + function humanizeTime(str) { // if (NVRDataModel.getLogin().useLocalTimeZone) |
