From 7eb5a9281ff24f13e50c0cd068df96660b1a1d81 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 9 Nov 2016 14:32:36 -0500 Subject: Added event time progression to video #362 --- www/js/EventModalCtrl.js | 25 +++++++++++++++++++++++-- www/templates/events-modal.html | 16 +++++++++++----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index abdf5052..94c11e25 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -6,7 +6,7 @@ -angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$rootScope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$q', '$sce', 'carouselUtils', '$ionicPopup', '$translate', function ($scope, $rootScope, zm, NVRDataModel, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $q, $sce, carouselUtils, $ionicPopup, $translate) { +angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$rootScope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$q', '$sce', 'carouselUtils', '$ionicPopup', '$translate', '$filter', function ($scope, $rootScope, zm, NVRDataModel, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $q, $sce, carouselUtils, $ionicPopup, $translate, $filter) { // from parent scope @@ -775,7 +775,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.scaleImage = function () { $scope.imageFit = !$scope.imageFit; - // console.log("Switching image style to " + $scope.imageFit); + console.log("Switching image style to " + $scope.imageFit); }; $scope.$on('$ionicView.enter', function () { @@ -907,6 +907,25 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro }); } + $scope.videoTime = function(s,c) + { + var a,o; + if (NVRDataModel.getLogin().useLocalTimeZone) + { + a = moment.tz(s, NVRDataModel.getTimeZoneNow()).tz(moment.tz.guess()); + + } + else + { + a = moment(s); + } + a.add(c); + + o = a.format("MMM Do "+NVRDataModel.getTimeFormatSec()); + $scope.videoDynamicTime = o; + //return a.format("MMM Do "+o); + + }; $scope.$on('modal.removed', function (e, m) { console.log ("************* REMOVE CALLED"); @@ -1467,6 +1486,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.videoObject = { config: { autoPlay: true, + responsive:true, + nativeControls:false, playsInline:true, sources: [ diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index 58573026..caa87e9e 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -4,6 +4,8 @@
+ +
@@ -17,17 +19,21 @@
-
+ + +
- - < - - + + + + + {{ videoTime(event.Event.StartTime, currentTime ); }} @@ -75,7 +81,7 @@ -
{{mName}}  {{humanizeTime}} ({{d_eventId}})
+
{{mName}}  {{videoDynamicTime}} ({{humanizeTime}}) [{{d_eventId}}]
  • -- cgit v1.2.3