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

How to stop all connections #36

Open
VGubarev opened this issue Jun 6, 2013 · 0 comments
Open

How to stop all connections #36

VGubarev opened this issue Jun 6, 2013 · 0 comments

Comments

@VGubarev
Copy link

VGubarev commented Jun 6, 2013

Hi, guys! I've got a problem. WebRTC.io have API for create connections, but how i can stop all connections and go out from room without restart page?
I have tried do this:
[js]
rtc.closeStreams = function() {
rtc.fire('disconnect stream', rtc._me);
for (id in rtc.peerConnections) {
if (typeof(rtc.peerConnections[id]) !== 'undefined') {
rtc.peerConnections[id].close();
}
delete rtc.peerConnections[id];
delete rtc.dataChannels[id];
delete rtc.connections[id];
}
};
[/js]
Yea, it closes all inner streams and stop camera, but server didn't sends to all other participants of room "remove peer connection".

How i can close all streams and alert clients that one of them go out from room ( without page restart)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant