add reloading for erronous disconnects

This commit is contained in:
Khush Jammu 2020-06-03 17:44:05 +08:00
parent fc1b1dc460
commit fb3c28b6aa
1 changed files with 6 additions and 0 deletions

View File

@ -203,6 +203,12 @@ var VideoChat = {
logIt("connected");
break;
case "disconnected":
// First possibility: we disconnected from the peer
if (VideoChat.socket.connect().connected === false) {
location.reload();
}
// Second possibility: the peer disconnected from us
logIt("disconnected - UUID " + uuid);
VideoChat.remoteVideoWrapper.removeChild(
document.querySelectorAll(`[uuid="${uuid}"]`)[0]