forked from arvindr21/pi_livestreaming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (45 loc) · 1.26 KB
/
index.html
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
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Stream My Aquarium</title>
<!-- Bootstrap CSS -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
#stream {
height: 99%;
margin: 0px auto;
display: block;
margin-top: 20px;
}
</style>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery.js"></script>
<!-- Bootstrap JavaScript -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
socket.on('liveStream', function(url) {
$('#stream').attr('src', url);
$('.start').hide();
});
function startStream() {
socket.emit('start-stream');
$('.start').hide();
}
</script>
</head>
<body class="container">
<h1 class="text-center">My Aquarium
<small>Powered by PI</small>
</h1>
<hr>
<button type="button" id="" class="btn btn-info start" onclick="startStream()">Start Camera</button>
<div class="row">
<img src="" id="stream">
</div>
</body>
</html>