{"action":"created","issue":{"url":"https://api.github.com/repos/feross/simple-peer/issues/68","repository_url":"https://api.github.com/repos/feross/simple-peer","labels_url":"https://api.github.com/repos/feross/simple-peer/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/feross/simple-peer/issues/68/comments","events_url":"https://api.github.com/repos/feross/simple-peer/issues/68/events","html_url":"https://github.com/feross/simple-peer/issues/68","id":138990607,"number":68,"title":"Create renegotiation method","user":{"login":"cusspvz","id":3604053,"avatar_url":"https://avatars.githubusercontent.com/u/3604053?v=3","gravatar_id":"","url":"https://api.github.com/users/cusspvz","html_url":"https://github.com/cusspvz","followers_url":"https://api.github.com/users/cusspvz/followers","following_url":"https://api.github.com/users/cusspvz/following{/other_user}","gists_url":"https://api.github.com/users/cusspvz/gists{/gist_id}","starred_url":"https://api.github.com/users/cusspvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cusspvz/subscriptions","organizations_url":"https://api.github.com/users/cusspvz/orgs","repos_url":"https://api.github.com/users/cusspvz/repos","events_url":"https://api.github.com/users/cusspvz/events{/privacy}","received_events_url":"https://api.github.com/users/cusspvz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-07T14:23:22Z","updated_at":"2016-03-16T12:54:25Z","closed_at":null,"body":"This should allow us to:\r\n* expose method to add streams `.addStream` #50\r\n* allow mutes and video interruption on the source side\r\n\r\n@feross has any work been initiated regarding renegotiation?"},"comment":{"url":"https://api.github.com/repos/feross/simple-peer/issues/comments/197309189","html_url":"https://github.com/feross/simple-peer/issues/68#issuecomment-197309189","issue_url":"https://api.github.com/repos/feross/simple-peer/issues/68","id":197309189,"user":{"login":"cusspvz","id":3604053,"avatar_url":"https://avatars.githubusercontent.com/u/3604053?v=3","gravatar_id":"","url":"https://api.github.com/users/cusspvz","html_url":"https://github.com/cusspvz","followers_url":"https://api.github.com/users/cusspvz/followers","following_url":"https://api.github.com/users/cusspvz/following{/other_user}","gists_url":"https://api.github.com/users/cusspvz/gists{/gist_id}","starred_url":"https://api.github.com/users/cusspvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cusspvz/subscriptions","organizations_url":"https://api.github.com/users/cusspvz/orgs","repos_url":"https://api.github.com/users/cusspvz/repos","events_url":"https://api.github.com/users/cusspvz/events{/privacy}","received_events_url":"https://api.github.com/users/cusspvz/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T12:54:25Z","updated_at":"2016-03-16T12:54:25Z","body":"@feross sorry for my late response, had to switch priorities. I've written a renegotiation capable software two years ago, but I cannot recall how it worked, have to dig in.\r\nI've already read your codebase, and I have **two ideas** for an implementation but I have to test the first one, because I don't know if it would work:\r\n\r\n* The first one is trying to re-use the same `PeerConnection`, by handling streams on it and creating offers and answers as soon as we spot a renegotiation is needed, which I think is impossible but is worth to try, and if we have success, it would be the easiest implementation.\r\n\r\n* The second one is to abstract `PeerConnection` interface from your current API, this way we could refactor some code and fix some bugs you had (related with stream destroying) without causing Breaking Changes on your current API design. This way there would be two main classes:\r\n  * `SimplePeer`\r\n    * Streamable Passthrough from the `currentPeerConnection`;\r\n    * PeerConnections Manager (handling renegotiations against streaming changes and  long-reconnecting delays);\r\n    * Signalling transporter gate from all `PeerConnections` (so we can initiate new ones before having data flowing through)\r\n  * `PeerConnection` - Streamable;\r\n\r\n"}}