summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/EventModalCtrl.js32
-rw-r--r--www/js/NVR.js2
-rwxr-xr-xwww/js/app.js2
-rw-r--r--www/templates/events-modal.html11
4 files changed, 43 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;
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index 821edb6e..67a174aa 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -245,6 +245,17 @@
</a>
</li>
+
+ <li ng-if="!isVideoLoading">
+ <a href="" ng-click="videoSeek(-10000)">
+ <i class="ion-arrow-return-left"></i> -10
+ </a>
+ </li>
+ <li ng-if="!isVideoLoading">
+ <a href="" ng-click="videoSeek(10000)">
+ <i class="ion-arrow-return-right"></i> +10
+ </a>
+ </li>
</ul>
</div>
</div>