replaceTrack

abstract fun replaceTrack(track: MediaStreamTrack)

Replaces the track being transmitted by this producer. This is essential for camera switching - the new camera's track must be sent to mediasoup so remote participants receive the new feed.

Parameters

track

The new MediaStreamTrack to transmit. For video producers, this should be the video track from the new camera stream.