Re: [webrtc-pc] Semi-sync replaceTrack API pre-initial-negotiation is bizarre.

The reasons are coming back to me: SRD is timing-critical. If users delay calling SRD(offer), the peer connection [won't be ready to receive ICE candidates](

So e.g. if users were to write:
let getMyTransceiver() = pc.getTransceivers())[0] || pc.addTransceiver("video");

signalingChannel.onmessage = async ({data: {sdp, candidate}}) => {
  if (sdp) {
    await getMyTransceiver().sender.replaceTrack(myVideoTrack); // Delays SRD!
    await pc.setRemoteDescription(sdp);
    if (sdp.type == "offer") {
      await pc.setLocalDescription(await pc.createAnswer());
      sc.send({sdp: pc.localDescription});
  } else if (candidate) await pc.addIceCandidate(candidate);
...they might occasionally miss ICE candidates, [a hard-to-find bug](

Possible solutions may be to either:
 1. Enqueue replaceTrack, or
 2. Allow `sender.track = myVideoTrack` IFF "transceiver is not yet associated with a media description"

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at using your GitHub account

Received on Monday, 12 February 2018 16:38:50 UTC