summaryrefslogtreecommitdiff
path: root/www/js/EventModalCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-11-22 13:58:25 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-11-22 13:58:25 -0400
commit265e3e201e0d61c2c5c504354dd582f6128ef1e8 (patch)
tree1b1cbb826dee6f9cae59c4290b209c0aee6f9ad3 /www/js/EventModalCtrl.js
parent4c4f0003bd44964e35d459203ac008a661aeb9f7 (diff)
currently hacked difference in time - computed a difference factor and multiplied it with all cues- so now cues are inside the player bar, but no idea if its accurate.#381
Diffstat (limited to 'www/js/EventModalCtrl.js')
-rw-r--r--www/js/EventModalCtrl.js37
1 files changed, 23 insertions, 14 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index 67023fce..70943e49 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -15,6 +15,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
var timeFormat = 'MM/DD/YYYY HH:mm:ss';
var event;
var gEvent;
+ var handle;
var framearray = {
@@ -157,13 +158,13 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
};
- $scope.onPlayerReady = function(handle)
+ $scope.onPlayerReady = function(api)
{
// we need this timeout to avoid load interrupting
// play -- I suppose its an angular digest foo thing
-
+ handle = api;
$ionicLoading.show(
{
@@ -176,8 +177,26 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
handle.setPlayback(2);
handle.play();
- // now set up cue points
+ }, 400);
+
+ // window.stop();
+ };
+
+ $scope.onCanPlay = function()
+ {
+ $ionicLoading.hide();
+ NVRDataModel.debug("This video can be played");
+ $scope.videoObject.config.cuepoints.points = [];
+ // now set up cue points
NVRDataModel.debug("Setting cue points..");
+ NVRDataModel.debug ("API-Total length:"+currentEvent.Event.Length);
+
+ var vt1 = $filter('date')(handle.totalTime, "ss");
+
+ NVRDataModel.debug ("reported player length:"+vt1);
+ var factor = vt1/currentEvent.Event.Length;
+ NVRDataModel.debug ("hack - conversion factor:"+factor);
+ //NVRDataModel.debug ("Video-Total length left:"+handle.timeLeft);
//console.log ("jEvent=" + JSON.stringify(currentEvent));
//var event = $scope.currentEvent.event;
// console.log (JSON.stringify(event));
@@ -187,23 +206,13 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
if (currentEvent.Frame[l].Type=='Alarm')
{
var ft = moment(currentEvent.Frame[l].TimeStamp);
- var s = Math.abs(st.diff(ft,'seconds'));
+ var s = factor*Math.abs(st.diff(ft,'seconds'));
//console.log("START="+currentEvent.Event.StartTime);
//console.log("END="+currentEvent.Frame[l].TimeStamp);
NVRDataModel.debug ("alarm cue at:"+s+"s");
$scope.videoObject.config.cuepoints.points.push({time:s});
}
}
-
- }, 400);
-
- // window.stop();
- };
-
- $scope.onCanPlay = function()
- {
- $ionicLoading.hide();
- NVRDataModel.debug("This video can be played");
};
$scope.onVideoError = function(event)