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

Close/leave room #131

Open
veezeepee opened this issue Jun 4, 2014 · 4 comments
Open

Close/leave room #131

veezeepee opened this issue Jun 4, 2014 · 4 comments

Comments

@veezeepee
Copy link

If I use the 'basic' SimpleWebRTC example I cannot work out how to 'leave/disconnect' from a room. My 'needs' are actually very simple the room is actually the page automatically e.g. the page has an automatic session variable rather than page.html#abc or page.html?id=abc - so from what I see/understand (newbie here ;)) (and to suit my purposes) the 'basic' code should surfice, however, I don't want the video to auto start and or auto request permission. I want that from a button 'Start Video' - get that to work, but then I cannot close/leave the room. (p.s. not very good with JS) - simple code: looks like (know cannot) what I cannot do is access webrtc inside closeVideo, but cannot fathom a way to get webrtc from startVideo() to closeVideo()

HTML
Start Video
Stop Video

JS

function startVideo(){
var webrtc = new SimpleWebRTC({
localVideoEl: 'localVideo',
remoteVideosEl: 'remoteVideos',
autoRequestMedia: false
});
webrtc.once('readyToCall', function () {
webrtc.joinRoom('your awesome room name');
});
}

function closeVideo(){
webrtc.connection.disconnect();
}

@devdemi
Copy link

devdemi commented Jun 18, 2014

try webrtc.leaveRoom();

@nsarkar
Copy link

nsarkar commented Jul 10, 2014

webrtc.leaveRoom() just disconnects the remote video. Is there a way to stop the localVideoStream. It seems like leaveRoom should do it but the code that calls stopScreenShare doesn't work. Any suggestions?
I see we have an issue where someone fixed this - #4.
Will try that.

@foligno
Copy link

foligno commented Jul 31, 2014

I'm currently using the following code to achieve that.

function hangUp() {
  webrtc.stopLocalVideo();
  webrtc.leaveRoom();
}

@namnemet
Copy link

how can i make a specific viewer to leave a room ?
or
perhaps shut down his ability to view the room? (if this is easier)

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

5 participants