Have a webrtc environment up and running without any problem when i get usermedia before starting sessions (e.g., at initialize time). However, when i get the usermedia on session initiation and answer, i am not successful at adding the answer side media to the session (i.e., the initiating side video is visible at the answer side but the answer side video is not visible at the initiating side). I have spent many hours trying to handle this without success and was hoping that someone could clarify a points on the processing of the onnegotiationneeded event.
Situation is as follows:
Side A initiates session, gets user media and once the usermedia is available and added to the peer connection, an SDP offer is generated and sent to the remote side.
Side B receives the offer, causes a ringing type event on screen and requests usermedia once the user decides to answer. The success call for the getusermedia adds a localdescription to the peer connection and at some point an onnegotiationeeded event is generated.
All seems to happen well (e.g., on side B - offer and candidates via the signaling channel, then have_remote_offer, remote stream added , etc..),
However, i am unclear whether the answering side should generate an SDP answer or an SDP offer after the renegotiation (i.e., when processing the onnegotiationneeded event).
Also, is it best to wait until the getusermedia returns a success before sending an SDP answer back, or should the SDP answer be sent based on the initiating side SDP offer, without waiting for the local usermedia and then sending another SDP (e.g., either offer or answer per the prior paragraph) after the onnegotiationneeded?
On a somewhat related question is the PRAnswer actually used - i have not seen such in the message traces.