I have a pretty simple RTCPeerConnection app running. Uses Firebase for signaling. The RTCPeerConnections get established, and then I take the stream, and do the following with it:
let streamURL = window.URL.createObjectURL(stream);
Then I take that streamURL
and set the video.src = streamURL
. That is how I get it to see the remote users' video. Then, when I am done with the connection (I want to end the conversation) I do the following:
peerConnection.getLocalStreams().forEach(stream=>{
stream.getTracks().forEach(t=>{
t.stop();
stream.removeTrack(t);
});
});
peerConnection.close();
This ends the connection, including turns off the green light for my local webcam. This tells me that things have ended for the most part.
Then I check chrome://webrtc-internals and the connection is still there. Even after I refresh, the connection is there. That seems odd. How can it still be there, even after a refresh? Please help. Am I not ending the RTCPeerConnection correctly? I thought this was the right way. I just can't figure out how the webrtc internals can still show it EVEN AFTER a page refresh. PLEASE HELP!