diff options
author | Florian <stayawake@lavabit.com> | 2014-02-07 15:22:41 +0100 |
---|---|---|
committer | Florian <stayawake@lavabit.com> | 2014-02-07 15:22:41 +0100 |
commit | e92d63f5e363a20b67b0a53ae1e470b8ad0e0918 (patch) | |
tree | 0123a40385268cbc1c55a8361d8ccd14ed9df9d0 /js | |
parent | 7d2bfcdbbf8115753c442fdf03df65356318e0c0 (diff) |
display no of active camera as overlay
Diffstat (limited to 'js')
-rw-r--r-- | js/cctv-control.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/cctv-control.js b/js/cctv-control.js index da49ca2..c79346d 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -13,8 +13,8 @@ var cam = 0; -var camHost = "172.22.80.56:8080"; -var controlHost = "172.22.80.56:8080"; +var camHost = "127.0.0.1:8080"; +var controlHost = "127.0.0.1:8080"; //create event which is triggered when DOM is ready window.onDomReady = initReady; @@ -32,7 +32,9 @@ function initReady(fn) { function changeCam() { var display = document.getElementById('screen'); if (cam <= 7 && cam >= 0) { - display.innerHTML = '<img src="http://' + camHost + '/cam/' + cam + '/stream.mjpeg" />'; + camDisplay = cam + 1; + display.innerHTML = '<p class="camnumber">' + camDisplay + '</p>'; + display.innerHTML += '<img src="http://' + camHost + '/cam/' + cam + '/stream.mjpeg" />'; } else { display.innerHTML = '<img src="img/testbild.png" />'; @@ -43,7 +45,7 @@ function changeCam() { function controlCam(direction) { if (direction == "left" || direction == "right" || direction == "up" || direction == "down") { var request = new XMLHttpRequest(); - request.open("get", "http://" + controlHost + "/cam/" + cam + "/control/" + direction + "left", false); + request.open("get", "http://" + controlHost + "/cam/" + cam + "/control/" + direction, false); request.send(); return false; } |