forked from utkuali/utk_streamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
36 lines (28 loc) · 1001 Bytes
/
server.js
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
onNet("utk_render:sendChatMessage", (data) => {
emitNet("utk_render:receiveChatMessage", -1, data);
})
onNet("utk_render:startStreaming", (data) => {
emitNet("utk_render:newStream", -1, data);
})
onNet("utk_render:joinStream", (data) => {
emitNet("utk_render:joinStream", -1, data);
})
onNet("utk_render:sendRTCOffer", (data) => {
emitNet("utk_render:sendRTCOffer", data.serverid, data);
})
onNet("utk_render:sendRTCAnswer", (data) => {
emitNet("utk_render:sendRTCAnswer", -1, data);
})
onNet("utk_render:newIceCandidateStreamer", (data) => {
console.log("sending to " + data.serverid);
emitNet("utk_render:newIceCandidateStreamer", data.serverid, data);
})
onNet("utk_render:newIceCandidateWatcher", (data) => {
emitNet("utk_render:newIceCandidateWatcher", -1, data);
})
onNet("utk_render:leaveStream", (data) => {
emitNet("utk_render:leaveStream", -1, data);
})
onNet("utk_render:stopStream", (data) => {
emitNet("utk_render:stopStream", -1, data);
})