Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on("stream") event should receive a unique MediaStream from a peer #639

Open
baptisteArno opened this issue Mar 29, 2020 · 2 comments
Open
Labels
bug client related to peerjs client confirmed acknowledged as an issue

Comments

@baptisteArno
Copy link

baptisteArno commented Mar 29, 2020

on("stream") event currently receives 2 MediaStream objects from a unique peer. Both of these streams contain the audio and video tracks. We should only receive the MediaStream once.

Capture d’écran 2020-03-29 à 22 07 19

@baptisteArno baptisteArno changed the title on("stream") event should receive a unique MediaStream from another peerjs on("stream") event should receive a unique MediaStream from a peer Mar 29, 2020
@TbreezyF
Copy link

TbreezyF commented Apr 10, 2020

You do have the MediaStream object sent once. The MediaStream however contains two tracks of type MediaStreamTrack. An audio and a video track

@afrokick
Copy link
Member

Because we fire on('stream') when peerConnection.ontrack called, so it called twice per one MediaStream with two tracks.

https://github.com/peers/peerjs/blob/master/lib/negotiator.ts#L145-L154

@afrokick afrokick added bug confirmed acknowledged as an issue labels Apr 20, 2020
@irgalamarr irgalamarr added the client related to peerjs client label Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug client related to peerjs client confirmed acknowledged as an issue
Projects
None yet
Development

No branches or pull requests

4 participants