aboutsummaryrefslogtreecommitdiff
path: root/server/events.js
blob: 99e6b37a47285f01810d04f52d3073a09d108a73 (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
export function addPeer(peerId, shouldCreateOffer) {
    return {
        peer_id: peerId,
        should_create_offer: shouldCreateOffer,
    }
}

export function removePeer(peerId) {
    return {
        peer_id: peerId,
    }
}

export function SessionDescriptionReceived(peerId, sessionDescription) {
    return {
        peer_id: peerId,
        session_description: sessionDescription,
    }
}

export function ICECandidateReceived(peerId, ICECandidate) {
    return {
        peer_id: peerId,
        ice_candidate: ICECandidate,
    }
}

export const types = {
  ADD_PEER: 'addPeer',
  REMOVE_PEER: 'removePeer',
  RELAY_SESSION_DESCRIPTION: 'relaySessionDescription',
  RELAY_ICE_CANDIDATE: 'relayICECandidate',
  ICE_CANDIDATE_RECEIVED: 'ICECandidateReceived',
  SESSION_DESCRIPTION_RECEIVED: 'SessionDescriptionReceived',
};