diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-08-30 18:11:57 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-08-30 18:11:57 +0200 |
| commit | 284fc661dc7f18aa32d0dbcd8e7f98cb16af4bb7 (patch) | |
| tree | 2aa2fd491858fc572ff6b95806b69ec9a79b29c8 /server/events.js | |
| parent | 8c7fb565690890d57b6af20ad0771a48cf82b4c7 (diff) | |
Add new RTC code
Diffstat (limited to 'server/events.js')
| -rw-r--r-- | server/events.js | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/server/events.js b/server/events.js index 99e6b37..3ef21a9 100644 --- a/server/events.js +++ b/server/events.js @@ -1,27 +1,41 @@ export function addPeer(peerId, shouldCreateOffer) { - return { - peer_id: peerId, - should_create_offer: shouldCreateOffer, - } + return { + peerId, + shouldCreateOffer, + } } export function removePeer(peerId) { return { - peer_id: peerId, + peerId, } } export function SessionDescriptionReceived(peerId, sessionDescription) { return { - peer_id: peerId, - session_description: sessionDescription, + peerId, + sessionDescription, + } +} + +export function ICECandidateReceived(peerId, candidate) { + return { + peerId, + candidate + } +} + +export function offerReceived(peerId, offer) { + return { + peerId, + offer } } -export function ICECandidateReceived(peerId, ICECandidate) { +export function answerReceived(peerId, answer) { return { - peer_id: peerId, - ice_candidate: ICECandidate, + peerId, + answer } } @@ -30,6 +44,8 @@ export const types = { REMOVE_PEER: 'removePeer', RELAY_SESSION_DESCRIPTION: 'relaySessionDescription', RELAY_ICE_CANDIDATE: 'relayICECandidate', + OFFER_RECEIVED: 'offerReceived', + ANSWER_RECEIVED: 'answerReceived', ICE_CANDIDATE_RECEIVED: 'ICECandidateReceived', SESSION_DESCRIPTION_RECEIVED: 'SessionDescriptionReceived', }; |