I am developing a WebRTC video streaming program which must be able to renegotiate rtc connections when a user wants to add a video stream. As it is my program closes the existing RTCPeerConnection sets the Connection
variable to null
then creates a new RTCPeerConnection and restarts the offer/answer exchange anew.
I have been getting the error :
Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.
after setting up the initial connection.
Why is this happening despite the fact that the connection was fully closed and set to null on both ends?