summaryrefslogtreecommitdiff
path: root/www/js/ModalCtrl.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/ModalCtrl.js')
-rw-r--r--www/js/ModalCtrl.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js
index 102bc46a..d8f61b03 100644
--- a/www/js/ModalCtrl.js
+++ b/www/js/ModalCtrl.js
@@ -123,15 +123,24 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
//-------------------------------------------------------------
// Send PTZ command to ZM
- // FIXME: moveCon is hardcoded - won't work with
- // cams that don't use moveCon.
- // Need to grab control ID and then control API
+ // Note: PTZ fails on desktop, don't bother about it
//-------------------------------------------------------------
function controlPTZ(monitorId, cmd) {
//curl -X POST "http://server.com/zm/index.php?view=request" -d
//"request=control&user=admin&passwd=xx&id=4&control=moveConLeft"
+ if (!$scope.ptzMoveCommand)
+ {
+ $ionicLoading.show({
+ template: "Not Ready for PTZ",
+ noBackdrop: true,
+ duration: 2000,
+ });
+ return;
+ }
+
+
console.log("Command value " + cmd + " with MID=" + monitorId);
$ionicLoading.hide();
$ionicLoading.show({
@@ -166,14 +175,19 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
console.log("****RETURNING " + foo);
return foo;
},
+ //FIXME: Refer to
+ // zoneminder/skins/mobile/includes/control_functions.php
+ // for move commands
+ // logic - /zm/api/monitors/X.json, read ControlId = Y
+ // then zm/api/controls/Y.json
data: {
view: "request",
request: "control",
id: monitorId,
- control: "moveCon" + cmd,
- xge: "30",
- yge: "30",
+ control: $scope.ptzMoveCommand + cmd,
+ xge: "30", //wtf
+ yge: "30", //wtf
}
});