diff --git a/public/js/chat.js b/public/js/chat.js index 3404d46..4c41278 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -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]