simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.65k stars 1.19k forks source link

Webrtc peer element sticks around when you leave a room #714

Closed JakeTrock closed 6 years ago

JakeTrock commented 6 years ago

I have a simplewebrtc room, and when one client leaves, their volume meter, and mute button are still there, is there any way to remove this when they leave the room? Code: https://pastebin.com/uuWA3E59

JakeTrock commented 6 years ago

I resolved this issue on my own by doing this timeout: var totalSeconds = 0; setInterval(setTime, 1000); function setTime() { totalSeconds += 1; if (totalSeconds > 300) { webrtc.leaveRoom(); //redirects to home dir(removed for security reasons) } }