Giuseppe Pes
Giuseppe Pes

Reputation: 7912

Concurrent local offers cause error

In my application I heavily use renegotiation to add and remove local streams. Unfortunately, the use of renegotiation may drastically increase the number of race conditions when offers and answers are exchanged.

Let's consider the following scenario :

create a local offer without any local stream              -- success 
setLocalDescription(offer)                                 -- success  
user grant access to the video which causes renegotiation  -- success 
create a local offer with  local stream                    -- success
setLocalDescription(offer)                                 -- failed 

The error thrown is :

Failed to set local offer sdp: Failed to push down transport description: Failed to set local identity.

More info

Upvotes: 1

Views: 686

Answers (1)

MarijnS95
MarijnS95

Reputation: 4793

I know from another question that it is not handy to attach the negotiation event handler directly as this wil trigger it twice (I don't know if that is in your case). What I tried was attaching the handler after I have successfully sent and received the SDP data. Then I caused negotiations by adding and removing streams and that works perfect. Also make sure that when you receive an SDP object you create a new RTCSessionDescription(<receivedObject>) and then append that to pc.remoteDescription.

Upvotes: 1

Related Questions