Adding multiple video tracks to a peer connection sends duplicate streams #972
Replies: 3 comments
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
I believe that you get the same video because you only get index 0 on tracks from the stream. You can see this in your code at this link: |
Beta Was this translation helpful? Give feedback.
-
Hi @marcus2vinicius. That's true. However, the track events are fired independently. If I start the stream.py with two videos from the CLI, we get 2 track events. Albeit, the tracks have overlapping videos. If you see stream.py#L81. |
Beta Was this translation helpful? Give feedback.
-
Adding multiple video tracks to a peer connection causes the
tracks
to be duplicated in the browser (Basically, always the last added track). Starting with the webcam example, I have modified the front-end and server code in the following repository.Basically, for each track in the comma-separated list of arguments for video sources, we create a media player and return video tracks for each source. In the client side, before negotiation, we add the necessary transceivers to the peer connection and add streams per track event in a new video element. However, each stream (even coming from a different track), plays the same video.
Beta Was this translation helpful? Give feedback.
All reactions