https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/replaceTrack
RTCRtpSender: replaceTrack() method - Web APIs | MDN
The RTCRtpSender method replaceTrack() replaces the track currently being used as the sender's source with a new MediaStreamTrack.
web apismethodmdn