forked from drewbharris/node-multi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster.html
More file actions
62 lines (56 loc) · 1.88 KB
/
master.html
File metadata and controls
62 lines (56 loc) · 1.88 KB
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
57
58
59
60
61
62
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://192.168.1.167'),
clients = [];
// function createClientsString(client){
// var clientsString = "";
// for (var i=0; i<clients.length; i++) {
// if (clients[i]) {
// clientsString = clientsString + clients[i] + "\n";
// }
// }
// return clientsString;
// }
$(document).ready(function(){
$("#play").click(function(){
socket.emit('masterEvent', {
'audioEvent': 'play'
});
});
$("#stop").click(function(){
socket.emit('masterEvent', {
'audioEvent': 'stop'
});
});
$("#reload").click(function(){
socket.emit('masterEvent', {
'audioEvent': 'reload'
});
});
socket.emit('masterEvent', {
'audioEvent': 'requestClientList'
});
});
socket.on('masterEvent', function(data){
console.log(data);
if (data.audioEvent === 'updateSources') {
$("#clients").html(data.sources);
}
});
// socket.on('clientList', function(data){
// $("#clients").text(data.list);
// });
</script>
</head>
<body>
<input type="button" id="play" value="play"/>
<input type="button" id="stop" value="stop"/>
<input type="button" id="reload" value="reload"/><br>
currently connected:
<div id="clients">
</div>
</body>
</html>