Reputation: 309
I am currently building a videochat web application with WebRTC. If a user disconnects, usually a package via a data channel is sent, so the other user knows that the connection is no longer available.
If the user e.g. just closes his browser tab, the other user will wait approx. 30 seconds before the webRTC client realizes, that the connection was lost. Is there any possibility to lower this timeout?
Upvotes: 1
Views: 1021
Reputation: 1081
Here, you can apply some basic logic to your code. First one, On directly tab close show confirmation pop up box to close tab. While user click on confirmation box to close tab you can send disconnected event to other user. OR other way you need to check connection in every time interval. If you don't find any active connection than you can disconnected it.
Upvotes: 1