-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
onremotestream called twice for each remote stream #1313
Comments
Upon further inspection, it seems that |
Actually it's not an issue or bug, but a direct consequence of when we introduced |
Thanks for the quick response, @lminiero! While I understand this isn't strictly speaking a "bug", I think it makes consuming remote streams just a bit clumsy. I am aware this is on the edge of OCD, but anytime I see an opportunity to make an interface cleaner I will always opt for it, especially in the open source world. I would be happy to submit a PR to change this behavior, or, at the very least, submit a PR to document this behavior. If you are open to either, please let me know and I would jump at the opportunity to assist. |
Since this would mean messing with MediaStream instances, both in janus.js and in the application itself, I think it's not a good idea and would rather keep it the way it is. Besides, how would I know that the fact I only get video the second time means that this is to be added to the audio I got before, and not that audio has been removed? I don't think the way it works now is broken, but should rather be seen as updates to what the current stream is. |
It seems that the
ontrack
event listener on instances ofRTCPeerConnection
is being called twice for each peer connection added to the session.I first observed this behavior in my application and confirmed it is consistent with the videoroom demo.
Since the ontrack handler is native funcationality, that leads me to beleive this is caused by Janus sending the same stream multiple times.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: