The removeTrack() method of the MediaStream interface removes a MediaStreamTrack from a stream.
removeTrack()
MDN Reference