Re: [webrtc-pc] Change stream associations (#2658)

> [RTCRtpSender.setStreams]( docs says:
> > setStreams() is purely additive. It doesn't remove the track from any streams; it adds it to new ones.

MDN is wrong. [setStreams]( is NOT additive. You may be running into [crbug 1396429]( in Chrome. So I'm closing this.

@alvestrand's advice is good, at least until setStreams has been implemented correctly in more browsers.

> Can the receiver dynamically change the associated stream multiple times? For example, when the active speaker changes.

RTCPeerConnection is track based, so you can put `receiver.track` in whatever streams you like. E.g.
video.srcObject = new MediaStream([myVideoTransceiver.receiver.track, myAudioTransceiver.receiver.track]);
You can also use [addTrack]( and [removeTrack]( to add or remove your track from whatever streams you want (streams are just dumb containers).

> Does not setting the streams at the sender side has any effect on the receiver?

Only that the receiver will no longer create streams as a convenience for you or automatically add/remove `transceiver.receiver.track` to/from them based on currentDirection.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Tuesday, 6 December 2022 21:33:58 UTC