]> git.r.bdr.sh - rbdr/junction/blob - server/events.js
Add new RTC code
[rbdr/junction] / server / events.js
1 export function addPeer(peerId, shouldCreateOffer) {
2 return {
3 peerId,
4 shouldCreateOffer,
5 }
6 }
7
8 export function removePeer(peerId) {
9 return {
10 peerId,
11 }
12 }
13
14 export function SessionDescriptionReceived(peerId, sessionDescription) {
15 return {
16 peerId,
17 sessionDescription,
18 }
19 }
20
21 export function ICECandidateReceived(peerId, candidate) {
22 return {
23 peerId,
24 candidate
25 }
26 }
27
28 export function offerReceived(peerId, offer) {
29 return {
30 peerId,
31 offer
32 }
33 }
34
35 export function answerReceived(peerId, answer) {
36 return {
37 peerId,
38 answer
39 }
40 }
41
42 export const types = {
43 ADD_PEER: 'addPeer',
44 REMOVE_PEER: 'removePeer',
45 RELAY_SESSION_DESCRIPTION: 'relaySessionDescription',
46 RELAY_ICE_CANDIDATE: 'relayICECandidate',
47 OFFER_RECEIVED: 'offerReceived',
48 ANSWER_RECEIVED: 'answerReceived',
49 ICE_CANDIDATE_RECEIVED: 'ICECandidateReceived',
50 SESSION_DESCRIPTION_RECEIVED: 'SessionDescriptionReceived',
51 };