Skip to content
Snippets Groups Projects
Commit b8248b0c authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Close WebRTC video correctly

parent c607d0eb
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ webrtc = {
if (webrtc.pc) {
if (webrtc.pc.signalingState != 'closed') {
webrtc.pc.getLocalStreams().forEach(function(stream) {stream.stop()})
webrtc.pc.getRemoteStreams().forEach(function(stream) {stream.stop()})
webrtc.pc.close();
webrtc.pc = undefined;
webrtc.mode = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment