From 89211bbbd526bbc587361085b119a19d296f6a7f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 20 Oct 2018 19:17:21 -0400 Subject: #724 cleanup and making sure we take recordingURL for playback --- www/js/EventModalCtrl.js | 59 +++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 38 deletions(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index b992017c..6c98c167 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -762,9 +762,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.mycarousel.index = 1; - if ($scope.event.Event.imageMode == 'path') { - url = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&path=" + $scope.relativePath + $scope.slides[$scope.mycarousel.index].img; - } else { + console.log("SLIDES " + JSON.stringify($scope.slides)); console.log("CAROUSEL " + JSON.stringify($scope.mycarousel)); @@ -772,7 +770,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro url = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&eid=" + $scope.eventId + "&fid=" + $scope.slides[$scope.mycarousel.index - 1].id; - } + if ($rootScope.authSession != 'undefined') { url += $rootScope.authSession; @@ -803,11 +801,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro onTap: function (e) { if ($scope.slideIndex > 0) $scope.slideIndex--; - if ($scope.event.Event.imageMode == 'path') { - $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&path=" + $scope.relativePath + $scope.slides[$scope.slideIndex].img; - } else { + $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&eid=" + $scope.eventId + "&fid=" + $scope.slides[$scope.slideIndex].id; - } + if ($rootScope.authSession != 'undefined') { $scope.selectEventUrl += $rootScope.authSession; @@ -831,11 +827,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro onTap: function (e) { if ($scope.slideIndex < $scope.slideLastIndex) $scope.slideIndex++; - if ($scope.event.Event.imageMode == 'path') { - $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&path=" + $scope.relativePath + $scope.slides[$scope.slideIndex].img; - } else { + $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&eid=" + $scope.eventId + "&fid=" + $scope.slides[$scope.slideIndex].id; - } + if ($rootScope.authSession != 'undefined') { $scope.selectEventUrl += $rootScope.authSession; @@ -860,11 +854,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro if (tempVar < 0) tempVar = 0; $scope.slideIndex = tempVar; - if ($scope.event.Event.imageMode == 'path') { - $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&path=" + $scope.relativePath + $scope.slides[$scope.slideIndex].img; - } else { + $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&eid=" + $scope.eventId + "&fid=" + $scope.slides[$scope.slideIndex].id; - } + if ($rootScope.authSession != 'undefined') { $scope.selectEventUrl += $rootScope.authSession; @@ -889,11 +881,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.slideIndex = tempVar; if ($scope.slideIndex < $scope.slideLastIndex) $scope.slideIndex++; - if ($scope.event.Event.imageMode == 'path') { - $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&path=" + $scope.relativePath + $scope.slides[$scope.slideIndex].img; - } else { + $scope.selectEventUrl = $scope.playbackURL + '/index.php?view=image&rand=' + $rootScope.rand + "&eid=" + $scope.eventId + "&fid=" + $scope.slides[$scope.slideIndex].id; - } + if ($rootScope.authSession != 'undefined') { $scope.selectEventUrl += $rootScope.authSession; @@ -1170,10 +1160,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.singleImageQuality = (NVRDataModel.getBandwidth() == "lowbw") ? zm.eventSingleImageQualityLowBW : ld.singleImageQuality; $scope.blockSlider = false; $scope.checkEventOn = false; - //$scope.singleImageQuality = 100; - - //$scope.commandURL = $scope.currentEvent.Event.baseURL+"/index.php"; - // NVRDataModel.log (">>>>>>>>>>>>>>>>>>ZMS url command is " + $scope.commandURL); + currentEvent = $scope.currentEvent; @@ -1924,7 +1911,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro function computeAlarmFrames(data) { $scope.alarm_images = []; tempAlarms = []; - $scope.FrameArray = data.event.Frame; + $scope.FrameArray = []; + + console.log ("FRAME ARRAY: "+JSON.stringify(data)); + if (data.event && data.event.Frame) $scope.FrameArray = data.event.Frame; var ts = 0; for (i = 0; i < data.event.Frame.length; i++) { @@ -1953,7 +1943,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.constructFrame = function (fid) { var frame = ""; - frame = currentEvent.Event.baseURL + "/index.php?view=image" + + frame = currentEvent.Event.recordingURL + "/index.php?view=image" + "&eid=" + currentEvent.Event.Id + "&fid=" + fid + "&height=" + 200; @@ -1985,7 +1975,6 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.mName = "..."; $scope.liveFeedMid = ''; - $http.get(myurl) .then(function (success) { @@ -1993,7 +1982,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro currentEvent = event; $scope.event = event; - + console.log ("prepareModal DATA:"+JSON.stringify(success.data)); computeAlarmFrames(success.data); $scope.eventWarning = ''; @@ -2008,8 +1997,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro event.Event.relativePath = computeRelativePath(event); event.Event.streamingURL = NVRDataModel.getStreamingURL(event.Event.MonitorId); - // event.Event.baseURL = NVRDataModel.getBaseURL (event.Event.MonitorId); - event.Event.baseURL = loginData.url; + + event.Event.recordingURL = loginData.url; event.Event.imageMode = NVRDataModel.getImageMode(event.Event.MonitorId); //console.log (JSON.stringify( success)); @@ -2056,10 +2045,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro event.Event.video = {}; var videoURL; - if ((event.Event.imageMode == 'path') || NVRDataModel.getLogin().forceImageModePath) - videoURL = event.Event.baseURL + "/events/" + event.Event.relativePath + event.Event.DefaultVideo; - else - videoURL = event.Event.baseURL + "/index.php?view=view_video&eid=" + event.Event.Id; + videoURL = event.Event.recordingURL + "/index.php?view=view_video&eid=" + event.Event.Id; if ($rootScope.authSession != 'undefined') videoURL += $rootScope.authSession; if ($rootScope.basicAuthToken) videoURL = videoURL + "&basicauth=" + $rootScope.basicAuthToken; @@ -2073,10 +2059,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro NVRDataModel.debug("Video url passed to player is: " + videoURL); - // console.log (">>>>>>>>>>>>>"+loginData.url+"-VS-"+event.Event.baseURL); - - //console.log("************** VIDEO IS " + videoURL); - + $scope.videoObject = { config: { autoPlay: true, -- cgit v1.2.3 From 3f549f3d6ea3dac1fbf862e236549ce0dd7fd570 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 21 Oct 2018 10:33:47 -0400 Subject: #724 more cleanup --- www/js/EventModalCtrl.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 6c98c167..7bd049a5 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1064,14 +1064,14 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro if (currentStreamState == streamState.STOPPED || !$scope.eventId) { stream = ""; } else if (currentStreamState == streamState.SNAPSHOT) { - stream = $scope.loginData.url + + stream = currentEvent.Event.recordingURL + "/index.php?view=image" + "&fid=" + $scope.snapshotFrameId + (!isGlobalFid ? "&eid=" + $scope.eventId : "") + "&scale=" + $scope.singleImageQuality + $rootScope.authSession; } else if (currentStreamState == streamState.ACTIVE) { - stream = $scope.loginData.streamingurl + + stream = currentEvent.Event.streamingURL + "/nph-zms?source=event&mode=jpeg" + "&event=" + $scope.eventId + "&frame=1" + "&replay=" + $scope.currentStreamMode + @@ -1082,9 +1082,11 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro } //console.log ($scope.connKey ); - //console.log ("STREAM="+stream); + //console.log ("EID="+$scope.eventId); if ($rootScope.basicAuthToken && stream) stream += "&basicauth=" + $rootScope.basicAuthToken; + + //console.log ("STREAM="+stream); return stream; }; @@ -1131,6 +1133,9 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro isSnapShotEnabled = true; currentStreamState = streamState.SNAPSHOT; if (m.snapshotId) { + + $scope.snapshotFrameId = m.snapshotId; + $scope.snapshotFrameId = m.snapshotId; isGlobalFid = true; } else { @@ -1913,7 +1918,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro tempAlarms = []; $scope.FrameArray = []; - console.log ("FRAME ARRAY: "+JSON.stringify(data)); + //console.log ("FRAME ARRAY: "+JSON.stringify(data)); if (data.event && data.event.Frame) $scope.FrameArray = data.event.Frame; var ts = 0; @@ -1950,7 +1955,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro if ($rootScope.authSession != 'undefined') frame += $rootScope.authSession; frame += NVRDataModel.insertBasicAuthToken(); - // console.log (frame); + //console.log ("alarm:"+frame); return frame; }; @@ -1982,7 +1987,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro currentEvent = event; $scope.event = event; - console.log ("prepareModal DATA:"+JSON.stringify(success.data)); + // console.log ("prepareModal DATA:"+JSON.stringify(success.data)); computeAlarmFrames(success.data); $scope.eventWarning = ''; @@ -1998,7 +2003,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro event.Event.streamingURL = NVRDataModel.getStreamingURL(event.Event.MonitorId); - event.Event.recordingURL = loginData.url; + event.Event.recordingURL = NVRDataModel.getRecordingURL(event.Event.MonitorId); event.Event.imageMode = NVRDataModel.getImageMode(event.Event.MonitorId); //console.log (JSON.stringify( success)); -- cgit v1.2.3 From e3ee3eeeb220cfce88ddfdb2189ec6e49432565f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 22 Oct 2018 09:38:27 -0400 Subject: other cleanup --- www/js/EventModalCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 7bd049a5..4097b92d 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -1303,7 +1303,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro } - NVRDataModel.debug("Deregistering broadcast handles"); + // NVRDataModel.debug("Deregistering broadcast handles"); for (var i = 0; i < broadcastHandles.length; i++) { // broadcastHandles[i](); } -- cgit v1.2.3 From da1db311fb6835e8d0b60cf073cd8803e96fe0a6 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 25 Oct 2018 13:06:47 -0400 Subject: fix live playback url, show snapshot instead of auto play #725 --- www/js/EventModalCtrl.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 4097b92d..58247239 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -349,7 +349,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro } }) .then(function (resp) { - NVRDataModel.debug("sendCmd response:" + JSON.stringify(resp)); + // NVRDataModel.debug("sendCmd response:" + JSON.stringify(resp)); d.resolve(resp); return (d.promise); @@ -1978,7 +1978,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro NVRDataModel.log("*** Constructed API for detailed events: " + myurl); $scope.humanizeTime = "..."; $scope.mName = "..."; - $scope.liveFeedMid = ''; + $scope.liveFeedMid = $scope.mid; $http.get(myurl) .then(function (success) { @@ -1986,6 +1986,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro var event = success.data.event; currentEvent = event; $scope.event = event; + $scope.currentEvent = event; // console.log ("prepareModal DATA:"+JSON.stringify(success.data)); computeAlarmFrames(success.data); @@ -2192,7 +2193,12 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro }, function (err) { NVRDataModel.log("Error retrieving detailed frame API " + JSON.stringify(err)); - NVRDataModel.displayBanner('error', ['could not retrieve frame details', 'please try again']); + NVRDataModel.displayBanner('error', ['could not retrieve frame details']); + $scope.eventWarning = $translate.instant('kLiveView'); + // if this happens we get to live feed + $scope.liveFeedMid = $scope.mid; + + }); } -- cgit v1.2.3 From 09a78638bd054f2188ddceaf59da4f144aec223a Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 26 Oct 2018 15:16:57 -0400 Subject: #725 make sure online/offline don't interfere --- www/js/EventModalCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 58247239..58c65399 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -2193,7 +2193,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro }, function (err) { NVRDataModel.log("Error retrieving detailed frame API " + JSON.stringify(err)); - NVRDataModel.displayBanner('error', ['could not retrieve frame details']); + // NVRDataModel.displayBanner('error', ['could not retrieve frame details']); $scope.eventWarning = $translate.instant('kLiveView'); // if this happens we get to live feed $scope.liveFeedMid = $scope.mid; -- cgit v1.2.3 From d630c9aebdf9425caca52f3c447b628d563beb0d Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 29 Oct 2018 09:17:54 -0400 Subject: removed old "force image path" error --- www/js/EventModalCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/EventModalCtrl.js') diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 58c65399..11a7434a 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -261,7 +261,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro NVRDataModel.debug("player reported a video error:" + JSON.stringify(event)); $rootScope.zmPopup = SecuredPopups.show('alert', { title: $translate.instant('kError'), - template: $rootScope.platformOS == 'desktop' ? $translate.instant('kVideoError') : $translate.instant('kVideoErrorMobile'), + template: $translate.instant('kVideoError'), okText: $translate.instant('kButtonOk'), cancelText: $translate.instant('kButtonCancel'), }); -- cgit v1.2.3