diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-27 18:15:07 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2020-09-27 18:15:07 +0200 |
| commit | 27a1c981529492981f08bb1c0ece4cb5d615c19b (patch) | |
| tree | 2489650e871d5c898452008a074d19505b15a7a4 /server/events.js | |
| parent | a94a5407e22b3287db369edad92679f98bc2cb52 (diff) | |
| parent | a69b770cb379354226a8c05be5cbea3e8703803f (diff) | |
Merge branch 'main' of gitlab.com:rbdr/junction into main
Diffstat (limited to 'server/events.js')
| -rw-r--r-- | server/events.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/server/events.js b/server/events.js new file mode 100644 index 0000000..062b7c1 --- /dev/null +++ b/server/events.js @@ -0,0 +1,41 @@ +function addPeer(peerId, shouldCreateOffer) { + return { + peer_id: peerId, + should_create_offer: shouldCreateOffer, + } +} + +function removePeer(peerId) { + return { + peer_id: peerId, + } +} + +function SessionDescriptionReceived(peerId, sessionDescription) { + return { + peer_id: peerId, + session_description: sessionDescription, + } +} + +function ICECandidateReceived(peerId, ICECandidate) { + return { + peer_id: peerId, + ice_candidate: ICECandidate, + } +} + +module.exports = { + types: { + ADD_PEER: 'addPeer', + REMOVE_PEER: 'removePeer', + RELAY_SESSION_DESCRIPTION: 'relaySessionDescription', + RELAY_ICE_CANDIDATE: 'relayICECandidate', + ICE_CANDIDATE_RECEIVED: 'ICECandidateReceived', + SESSION_DESCRIPTION_RECEIVED: 'SessionDescriptionReceived', + }, + addPeer, + removePeer, + SessionDescriptionReceived: SessionDescriptionReceived, + ICECandidateReceived: ICECandidateReceived, +}
\ No newline at end of file |