X-Git-Url: https://git.r.bdr.sh/rbdr/junction/blobdiff_plain/8c7fb565690890d57b6af20ad0771a48cf82b4c7..284fc661dc7f18aa32d0dbcd8e7f98cb16af4bb7:/server/events.js?ds=sidebyside 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', };