diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-07-19 16:47:04 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-07-19 16:47:04 -0400 |
| commit | e8c2483e74b38b3d2f8a1d662574a23a6aabad64 (patch) | |
| tree | b02a2696d3fe5b1d219d40ed799887f865ca5bc7 /www/js/EventModalCtrl.js | |
| parent | 88bdea176231fdc96db04bb41736ed177d52503a (diff) | |
don't play video on scrub if it was paused, disallow swipe for 1s if control bar was scrubbed
Diffstat (limited to 'www/js/EventModalCtrl.js')
| -rw-r--r-- | www/js/EventModalCtrl.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index d5a410f9..c557ff6a 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -27,6 +27,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro //var isGlobalFid = false; // true if its set to MaxScoreFrameId in events var eventId = 0; var isSnapShotEnabled = false; + var playState = 'play' @@ -197,6 +198,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.onPlayerState = function (state) { // parent scope + playState = state; $scope.lastVideoStateTime.time = moment(); }; @@ -253,7 +255,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro var rate = NVR.getLogin().videoPlaybackSpeed; NVR.debug ("Invoking play at rate:"+rate+" as video can be played"); handle.setPlayback (rate); - handle.play(); + if (playState== 'play') handle.play(); + }; $scope.onVideoError = function (event) { @@ -1533,6 +1536,11 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.onSwipeEvent = function (eid, dirn) { + var diff = moment().diff($scope.lastVideoStateTime.time); + if (diff <= 1000) { + NVR.debug ("Not swiping, time interval was only:"+diff+" ms"); + return; + } //console.log("CALLED WITH " + eid + " dirn " + dirn); if ($ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition().zoom != 1) { //console.log("Image is zoomed in - not honoring swipe"); |
