summaryrefslogtreecommitdiff
path: root/js/cctv-control.js.bak
blob: 7a12dcef070bf68434b39aea19b2e73fb0e9433a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var cam;

function keyDown(event)	{
	if (event.keyCode == 49)	{
		var display = document.getElementById('screen');
		cam = 0;
		display.innerHTML = '<img src="http://172.22.80.56:8080/cam/0/stream.mjpeg" />'
		}

	if (event.keyCode == 50)	{
		var display = document.getElementById('screen');
		cam = 1;
		display.innerHTML = '<img src="http://172.22.80.56:8080/cam/1/stream.mjpeg" />'
		}

	if (event.keyCode == 51)	{
		var display = document.getElementById('screen');
		cam = 2;
		display.innerHTML = '<img src="http://172.22.80.56:8080/cam/2/stream.mjpeg" />'
		}

	if (event.keyCode == 52)	{
		var display = document.getElementById('screen');
		display.innerHTML = '<img src="testbild-4.png" />'
		}

	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;
	
	}

}