Closed fblundun closed 2 years ago
@fblundun ,
You are correct. The master connection needs to be opened first so that the offer sent by the viewer can be consumed. If you refresh the master page, the viewer needs to resend the offer. This kind of handshake mechanism will have to be incorporated outside of the realm of WebRTC. You can have some kind of=handshake message between master and viewer to allow this.
In my code, the "viewer" side of the WebRTC call uses the
KVSWebRTC.SignalingClient.sendSdpOffer
function to send an SDP offer, and the "master" side of the call listens for "sdpOffer" events and reacts to them by callingKVSWebRTC.SignalingClient.sendSdpAnswer
.This usually all works fine. But I've found that the following sequence of events can happen:
Am I correct in thinking that the SDP offer is "consumed" when the master side signalling client first fires the "sdpOffer" event?
What's the appropriate way to handle this? Is the viewer side supposed to speculatively make fresh SDP offers every few seconds, in case the above sequence of events has occurred? Is there any way for the viewer side to know that their SDP offer has been lost?
(I also asked this on StackOverflow: https://stackoverflow.com/questions/72690321/how-do-i-rescue-my-webrtc-connection-when-my-sdp-offer-is-swallowed)