From 918591b770565a34b20a787946a6f64553447894 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 24 Jan 2014 12:35:41 +0100 Subject: initial commit --- cam.html | 13 +++++++ css/cam.css | 12 +++++++ img/arrow.svg | 65 ++++++++++++++++++++++++++++++++++ img/down.png | Bin 0 -> 983 bytes img/left.png | Bin 0 -> 753 bytes img/right.png | Bin 0 -> 742 bytes img/testbild-1.png | Bin 0 -> 712957 bytes img/testbild-2.png | Bin 0 -> 701650 bytes img/testbild-3.png | Bin 0 -> 702190 bytes img/testbild-4.png | Bin 0 -> 699394 bytes img/testbild-4.xcf | Bin 0 -> 939871 bytes img/testbild.gif | Bin 0 -> 1097329 bytes img/testbild.png | Bin 0 -> 733994 bytes img/testbild.xcf | Bin 0 -> 1233876 bytes img/up.png | Bin 0 -> 977 bytes js/.main.js.swp | Bin 0 -> 12288 bytes js/cctv-control.js | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ js/main.js | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++ js/main.js.bak | 55 +++++++++++++++++++++++++++++ 19 files changed, 338 insertions(+) create mode 100644 cam.html create mode 100644 css/cam.css create mode 100644 img/arrow.svg create mode 100644 img/down.png create mode 100644 img/left.png create mode 100644 img/right.png create mode 100644 img/testbild-1.png create mode 100644 img/testbild-2.png create mode 100644 img/testbild-3.png create mode 100644 img/testbild-4.png create mode 100644 img/testbild-4.xcf create mode 100644 img/testbild.gif create mode 100644 img/testbild.png create mode 100644 img/testbild.xcf create mode 100644 img/up.png create mode 100644 js/.main.js.swp create mode 100644 js/cctv-control.js create mode 100644 js/main.js create mode 100644 js/main.js.bak diff --git a/cam.html b/cam.html new file mode 100644 index 0000000..60aed46 --- /dev/null +++ b/cam.html @@ -0,0 +1,13 @@ + + + + + + + + +
+ +
+ + diff --git a/css/cam.css b/css/cam.css new file mode 100644 index 0000000..2155efa --- /dev/null +++ b/css/cam.css @@ -0,0 +1,12 @@ +img.fullscreen { + min-height: 100%; + min-width: 1024px; + + width: 100%; + height: auto; + + position: fixed; + top: 0; + left: 0; + +} diff --git a/img/arrow.svg b/img/arrow.svg new file mode 100644 index 0000000..02a1b18 --- /dev/null +++ b/img/arrow.svg @@ -0,0 +1,65 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/down.png b/img/down.png new file mode 100644 index 0000000..e7cad41 Binary files /dev/null and b/img/down.png differ diff --git a/img/left.png b/img/left.png new file mode 100644 index 0000000..058e0d5 Binary files /dev/null and b/img/left.png differ diff --git a/img/right.png b/img/right.png new file mode 100644 index 0000000..415fb5d Binary files /dev/null and b/img/right.png differ diff --git a/img/testbild-1.png b/img/testbild-1.png new file mode 100644 index 0000000..cae27b6 Binary files /dev/null and b/img/testbild-1.png differ diff --git a/img/testbild-2.png b/img/testbild-2.png new file mode 100644 index 0000000..804ca63 Binary files /dev/null and b/img/testbild-2.png differ diff --git a/img/testbild-3.png b/img/testbild-3.png new file mode 100644 index 0000000..cc0f3b3 Binary files /dev/null and b/img/testbild-3.png differ diff --git a/img/testbild-4.png b/img/testbild-4.png new file mode 100644 index 0000000..1b73190 Binary files /dev/null and b/img/testbild-4.png differ diff --git a/img/testbild-4.xcf b/img/testbild-4.xcf new file mode 100644 index 0000000..c844b06 Binary files /dev/null and b/img/testbild-4.xcf differ diff --git a/img/testbild.gif b/img/testbild.gif new file mode 100644 index 0000000..19ea023 Binary files /dev/null and b/img/testbild.gif differ diff --git a/img/testbild.png b/img/testbild.png new file mode 100644 index 0000000..82b1339 Binary files /dev/null and b/img/testbild.png differ diff --git a/img/testbild.xcf b/img/testbild.xcf new file mode 100644 index 0000000..e23beed Binary files /dev/null and b/img/testbild.xcf differ diff --git a/img/up.png b/img/up.png new file mode 100644 index 0000000..ed95bbd Binary files /dev/null and b/img/up.png differ diff --git a/js/.main.js.swp b/js/.main.js.swp new file mode 100644 index 0000000..b3ba802 Binary files /dev/null and b/js/.main.js.swp differ diff --git a/js/cctv-control.js b/js/cctv-control.js new file mode 100644 index 0000000..09e978f --- /dev/null +++ b/js/cctv-control.js @@ -0,0 +1,93 @@ +// Small lib to +// +// +// +// + + +var cam = 0; +var camHost = "172.22.80.56:8080"; +var controlHost = "172.22.80.56:8080"; + +//create event which is triggered when DOM is ready +window.onDomReady = initReady; + +//change from testbild to default cam when DOM is ready +window.onDomReady(changeCam); + +function initReady(fn) { + if(document.addEventListener) { + document.addEventListener("DOMContentLoaded", fn, false); + } +} + +//change currently displayed camera to the one in cam variable +function changeCam() { + var display = document.getElementById('screen'); + if (cam <= 7 && cam >= 0) { + display.innerHTML = ''; + } + else { + display.innerHTML = ''; + } +} + +//send control command to currently selected camera +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.send(); + return false; + } + + +function keyDown(event) { + + switch(event.keyCode) { + case 49: // 1 + cam = 0; + changeCam(); + break; + case 50: // 2 + cam = 1; + changeCam(); + break; + case 51: // 3 + cam = 2; + changeCam(); + break; + case 52: // 4 + cam = 3; + changeCam(); + break; + case 53: // 5 + cam = 4; + changeCam(); + break; + case 54: // 6 + cam = 5; + changeCam(); + break; + case 55: // 7 + cam = 6; + changeCam(); + break; + case 56: // 8 + cam = 7; + changeCam(); + break; + case 37: // arrow left + controlCam("left"); + break; + case 38: // arrow up + controlCam("up"); + break; + case 39: // arrow right + controlCam("right"); + break; + case 40: // arrow down + controlCam("down"); + break; + } +} diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..b85fa89 --- /dev/null +++ b/js/main.js @@ -0,0 +1,100 @@ +// CCTV Control +// +// Author: Florian Raemisch +// Email: olf@subsignal.org +// +// cctv-control is a webinterface to control and view +// mjpeg encoded videos by cctv cameras which are +// proxied by mjpegplexer. camera control is possible +// with arrow-keys, if mjpegplexer is configured +// properly. +// +// This Software is licensed under the GPL Version 3, 29 June 2007 + + +var cam = 0; +var camHost = "172.22.80.56:8080"; +var controlHost = "172.22.80.56:8080"; + +//create event which is triggered when DOM is ready +window.onDomReady = initReady; + +//change from testbild to default cam when DOM is ready +window.onDomReady(changeCam); + +function initReady(fn) { + if(document.addEventListener) { + document.addEventListener("DOMContentLoaded", fn, false); + } +} + +//change currently displayed camera to the one in cam variable +function changeCam() { + var display = document.getElementById('screen'); + if (cam <= 7 && cam >= 0) { + display.innerHTML = ''; + } + else { + display.innerHTML = ''; + } +} + +//send control command to currently selected camera +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.send(); + return false; + } + + +function keyDown(event) { + + switch(event.keyCode) { + case 49: // 1 + cam = 0; + changeCam(); + break; + case 50: // 2 + cam = 1; + changeCam(); + break; + case 51: // 3 + cam = 2; + changeCam(); + break; + case 52: // 4 + cam = 3; + changeCam(); + break; + case 53: // 5 + cam = 4; + changeCam(); + break; + case 54: // 6 + cam = 5; + changeCam(); + break; + case 55: // 7 + cam = 6; + changeCam(); + break; + case 56: // 8 + cam = 7; + changeCam(); + break; + case 37: // arrow left + controlCam("left"); + break; + case 38: // arrow up + controlCam("up"); + break; + case 39: // arrow right + controlCam("right"); + break; + case 40: // arrow down + controlCam("down"); + break; + } +} diff --git a/js/main.js.bak b/js/main.js.bak new file mode 100644 index 0000000..7a12dce --- /dev/null +++ b/js/main.js.bak @@ -0,0 +1,55 @@ +var cam; + +function keyDown(event) { + if (event.keyCode == 49) { + var display = document.getElementById('screen'); + cam = 0; + display.innerHTML = '' + } + + if (event.keyCode == 50) { + var display = document.getElementById('screen'); + cam = 1; + display.innerHTML = '' + } + + if (event.keyCode == 51) { + var display = document.getElementById('screen'); + cam = 2; + display.innerHTML = '' + } + + if (event.keyCode == 52) { + var display = document.getElementById('screen'); + display.innerHTML = '' + } + + if (event.keyCode == 37) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam + "/control/left", false); + request.send(); + return false; + } + + if (event.keyCode == 38) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/up", false); + request.send(); + return false; + + } + if (event.keyCode == 39) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/right", false); + request.send(); + return false; + } + if (event.keyCode == 40) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/down", false); + request.send(); + return false; + + } + +} -- cgit v1.2.1