-
-
Notifications
You must be signed in to change notification settings - Fork 978
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
expose addStream on prototype #50
Comments
The downside of creating streams lazily is then you have to handle renegotiation. |
As an alternative to renegotiation, it's possible to merge MediaStreams before passing them into simple-peer. You can add/remove streams to this merged stream as you please, without renegotiation. Not the ideal solution, but it's a workaround for some usecases until the spec around multistreaming stabilizes. |
To force renegotation, I've been destroying and recreating Peer objects, and although this may involve slightly more renogiation than necessary it's been working for me. If you're using react, check out the component I've wrapped it in to handle that logic for me https://github.com/ben-pr-p/assemble/blob/master/client/room/user-blob/webrtc/react-simple-peer.js If you pass the component a new stream, it will handle renegotiation by destroying and recreating a Peer object internally. |
@rationalcoding I think your library looks like a promising solution for this problem, but I have a few questions:
|
Being solved at #250 |
Implemented in #250. |
right now you can only specify the stream in the constructor
you should be able to do it lazily after the connection has been opened, that way you can start the connection process as soon as possible instead of handling camera access and connection in series
The text was updated successfully, but these errors were encountered: