]> git.r.bdr.sh - rbdr/junction/blame - server/events.js
New URL
[rbdr/junction] / server / events.js
CommitLineData
ed9f8fd5 1function addPeer(peerId, shouldCreateOffer) {
2 return {
3 peer_id: peerId,
4 should_create_offer: shouldCreateOffer,
5 }
6}
7
8function removePeer(peerId) {
9 return {
10 peer_id: peerId,
11 }
12}
13
14function SessionDescriptionReceived(peerId, sessionDescription) {
15 return {
16 peer_id: peerId,
17 session_description: sessionDescription,
18 }
19}
20
21function ICECandidateReceived(peerId, ICECandidate) {
22 return {
23 peer_id: peerId,
24 ice_candidate: ICECandidate,
25 }
26}
27
28module.exports = {
29 types: {
30 ADD_PEER: 'addPeer',
31 REMOVE_PEER: 'removePeer',
32 RELAY_SESSION_DESCRIPTION: 'relaySessionDescription',
33 RELAY_ICE_CANDIDATE: 'relayICECandidate',
34 ICE_CANDIDATE_RECEIVED: 'ICECandidateReceived',
35 SESSION_DESCRIPTION_RECEIVED: 'SessionDescriptionReceived',
36 },
37 addPeer,
38 removePeer,
39 SessionDescriptionReceived: SessionDescriptionReceived,
40 ICECandidateReceived: ICECandidateReceived,
41}