I managed to create a video chat in my Cordova app using PhoneRTC. Now, I want to add a button that toggles mute on the local microphone output.
How can I do that?
You don't want to renegotiate to implement muting.
You want to get the audio (and maybe video) mediastreamtrack, and do track.enabled = false. That makes it silence (audio) or black (video).
Renegotiation requires at least several RTT to complete and can fail (and Firefox doesn't support it yet, requiring creating a new PeerConnection to replace the old one).