diff options
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/EventModalCtrl.js | 32 | ||||
| -rw-r--r-- | www/js/NVR.js | 2 | ||||
| -rwxr-xr-x | www/js/app.js | 2 |
3 files changed, 32 insertions, 4 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 228817c5..351253c8 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -33,7 +33,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro var eventId = 0; var isSnapShotEnabled = false; var playState = 'play'; - + var isSeeking = false; $scope.useFilters = true; @@ -255,7 +255,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.onPlaybackUpdate = function (rate) { - + var ld = NVR.getLogin(); if (ld.videoPlaybackSpeed != rate) { NVR.debug ("Update video rate to:"+rate); @@ -271,8 +271,34 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro }; + $scope.videoSeek = function (val) { + + if (!handle) { + NVR.debug ("Can't seek. Video not playing"); + return; + } + isSeeking = true; + //console.log ("You asked:"+val); + //console.log (handle.totalTime); + //console.log(handle.timeLeft); + var newTime = handle.currentTime + val; + if (newTime > handle.totalTime) newTime =handle.totalTime; + if (newTime < 0) newTime =0; + NVR.debug ("Skipping from " + handle.currentTime + " to "+ newTime); + handle.seekTime(newTime/1000,false); + + + + }; + $scope.onCanPlay = function () { + if (isSeeking) { + NVR.debug ("onCanPlay: triggered due to seek, skipping"); + isSkipping = false; + return; + } + $ionicLoading.hide(); $scope.isVideoLoading = false; NVR.debug("This video can be played"); @@ -1270,6 +1296,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.videoTime = function (s, c) { // console.log ("VIDEO TIME WITH "+s+ " and "+c); + //console.log ("$currentTime="+c); + //console.log ("handle currentTime="+handle.currentTime); var a, o; if (NVR.getLogin().useLocalTimeZone) { a = moment.tz(s, NVR.getTimeZoneNow()).tz(moment.tz.guess()); diff --git a/www/js/NVR.js b/www/js/NVR.js index 5af67a8c..2278ad54 100644 --- a/www/js/NVR.js +++ b/www/js/NVR.js @@ -1902,7 +1902,7 @@ angular.module('zmApp.controllers') var cid = loginData.zmNinjaCustomId.replace('%APPVER%', zmAppVersion); tokens+='&id='+cid; } - + if (loginData.insertBasicAuthToken && $rootScope.basicAuthToken) { tokens += "&basicauth=" + $rootScope.basicAuthToken; } diff --git a/www/js/app.js b/www/js/app.js index baf51648..26fef2fb 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -1520,7 +1520,7 @@ angular.module('zmApp', [ $rootScope.$on('$stateChangeStart', function (event, toState, toParams) { - if (!$rootScope.initComplete && (toState.name!= 'app.first-use')) { + if (!$rootScope.initComplete && toState.name!= 'app.first-use') { NVR.debug ("---> Init not complete, ignoring state change request to "+toState.name); event.preventDefault(); return; |
