From e8c2483e74b38b3d2f8a1d662574a23a6aabad64 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 19 Jul 2019 16:47:04 -0400 Subject: don't play video on scrub if it was paused, disallow swipe for 1s if control bar was scrubbed --- www/js/EventModalCtrl.js | 10 +++++++++- www/templates/events-modal.html | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'www') 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"); diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index 34ec051b..53ec2f61 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -77,7 +77,7 @@ vg-update-time="videoTime(event.Event.StartTime,$currentTime)" vg-error="onVideoError($event)"> - + {{ videoTime(event.Event.StartTime, currentTime ); }} @@ -131,7 +131,7 @@
-