Draft
This page is not complete.
This page is being used to plan out an event flow chart for WebRTC signaling. It's just temporary.
Naomi's client (caller)
Naomi's browser
Signaling server
Priya's browser
Priya's client (callee)
invite() calls setupVideoCall()
setupVideoCall()
Create RTCPeerConnection
Call navigator.mediaDevices.getUserMedia() to get access to webcam and microphone
Promise fulfilled: add the local stream by calling RTCPeerConnection.addStream()
Send "video-invite" to Priya through the signaling server
on.message() receives the "video-invite" message and forwards it to Priya
handleVideoInviteMsg() records the name of the caller (Naomi) and then calls setupVideoCall()
setupVideoCall()
Create RTCPeerConnection
Call navigator.mediaDevices.getUserMedia() to get access to webcam and microphone
Promise fulfilled: add the local stream by calling RTCPeerConnection.addStream()
Send "video-accept" to Naomi through the signaling server
on.message() receives the "video-accept" message and forwards it to Naomi
Signaling process begins
handleVideoAcceptMsg():
Create an SDP offer by calling RTCPeerConnection.createOffer()
Promise fulfilled: set the description of Naomi's end of the call by calling RTCPeerConnection.setLocalDescription()
Promise fulfilled: send the offer to Priya in a message of type "sdp-offer" (through the signaling server)
Starts sending ICE candidates to Priya's browser , which will queue them up until it's ready for them
Generate an ICE candidate object
Send an icecandidate event to Naomi's client, asking it to forward the candidate to Priya using the signaling channel
handleICECandidateEvent() fires to handle the icecandidate event; the candidate is forwarded to Priya by sending a "new-ice-candidate" message which encapsulates it
on.message() receives "sdp-offer" and forwards it to Priya
on.message() receives "new-ice-candidate" and forwards it to Priya
handleOfferMsg() receives "sdp-offer" message and handle it:
Create an RTCSessionDescription object using the received SDP offer
Call RTCPeerConnection.setRemoteDescription() to tell WebRTC about Naomi's configuration
Promise fulfilled: call RTCPeerConnection.createAnswer() to create an answer to send to Naomi
Promise fulfilled: configure Priya's end of the connection to match the generated answer by passing it to RTCPeerConnection.setLocalDescription()
Promise fulfilled: send a message of type "sdp-answer" to Naomi, which includes the SDP answer object
handleNewICECandidateMsg() receives the "new-ice-candidate" message and passes it along to the browser by calling RTCPeerConnection.addIceCandidate()
Now accepting ICE candidates from Priya
RTCPeerConnection.addIceCandidate() adds the received ICE candidate to the list of possible ICE configurations supported by Naomi's browser
Starts sending ICE candidates to Naomi's browser
on.message() receives the "sdp-answer" and forwards it to Naomi
handleAnswerMsg() receives "sdp-answer" mesage and handles it:
Create an RTCSessionDescription object using the received SDP answer
Pass it to RTCPeerConnection.setRemoteDescription() to configure Naomi's WebRTC layer to know how Priya's end of the call is configured
Document Tags and Contributors
Contributors to this page:
Sheppy
Last updated by:
Sheppy ,
Dec 31, 2015, 4:29:56 PM