Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fully close a WebRTC connection [duplicate]

When I am trying to close the WebRTC connection after a call using rtc.close(), I recognize that about:webrtc-internals in Chrome and about:webrtc keep the connections listed. In Firefox, they are marked as closed, while in Chrome I could not see such a denotation.

I am asking because this seems to have a significant performance impact after some time. After having done a lot of calls, the performance is significantly impaired and webrtc-internals lists a large number of connections.

Is there anything more to closing a WebRTC connection than .close() to make the browser fully forget about the connection?

like image 312
nexus Avatar asked Dec 21 '25 02:12

nexus


1 Answers

You should see the peer connection go to ICEConnectionStateClosed and SignalingStateClosed. One thing that you should do is ensure that you're stopping all local media stream tracks. If you don't, the browser will keep them open, because they aren't closed when a peer connection is closed.

pc closed

like image 76
xdumaine Avatar answered Dec 23 '25 22:12

xdumaine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!