Skip to content

Can I change the current MediaStream? #1253

Answered by ha-ves
HighOnLemonz asked this question in Q&A
Discussion options

You must be logged in to vote

All good 👍

The client will wish to switch the streamed video. From my side, I want to either "load" multiple tracks and then stream the one the client askes for or load the new track on the spot and start streaming it then. Only video streaming is required.

This is possible, the receiving WebRTC implementation would also need to do the switching of the track being selected by the user in case of a single view.

If it's a browser, usually you will change the video element source to the selected MediaStream and then pause the other streams.

If it's a multi-view at once, then set the video element to the corresponding MediaStreams.

I assume that calling addTrack multiple times before the n…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@ha-ves
Comment options

@HighOnLemonz
Comment options

@ha-ves
Comment options

Answer selected by HighOnLemonz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants