According to the MDN, RtcPeerConnection.removeTrack()
“Tells the local end of the connection to stop
sending media from the specified track, without actually removing the corresponding RTCRtpSender
from the list of senders as reported by getSenders()”.
First I add video and audio track, webrtc connection works fine.
Then I add extra audio track and remove it calling RtcPeerconnection.removeTrack()
. expecting that 2 first track must remain only.
After calling removeTrack for extra track on a local computer I observe a renegotiation, but then I see that “removed” track/receiver remains in the list ot receivers of a peer (javascript, Firefox v. 112.0.1).
My question is:
how can I remove both track and sender(on the local)/receiver(on the peer), but not close RtcPeerConnection
at all ?