From 6773c1913895c0fddd1b8e069ba37007e409afe8 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 17 Mar 2015 18:20:21 +0100 Subject: [PATCH] Notify on p2p failure And terminate conenction with this peer Fix #95 --- lib/Vroom/I18N/en.pm | 1 + lib/Vroom/I18N/fr.pm | 1 + public/js/vroom.js | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/lib/Vroom/I18N/en.pm b/lib/Vroom/I18N/en.pm index 329f14c..05fdfde 100644 --- a/lib/Vroom/I18N/en.pm +++ b/lib/Vroom/I18N/en.pm @@ -18,6 +18,7 @@ our %Lexicon = ( "ERROR_DB_UNAVAILABLE" => "The database is not available", "ERROR_DB_VERSION_MISMATCH" => "The database must be updated", "ERROR_TOO_MANY_MEMBERS" => "This room reached its members limit", + "ERROR_ESTABLISHING_P2P" => "Cannot establish a connection with a participant", "JS_REQUIRED" => "VROOM needs javascript to work properly", "EMAIL_INVITATION" => "Video conference invitation", "INVITE_SENT_TO_s" => "An invitation was sent to the following addresses\n%s", diff --git a/lib/Vroom/I18N/fr.pm b/lib/Vroom/I18N/fr.pm index 7d95fd8..d0a110f 100644 --- a/lib/Vroom/I18N/fr.pm +++ b/lib/Vroom/I18N/fr.pm @@ -20,6 +20,7 @@ our %Lexicon = ( "ERROR_DB_UNAVAILABLE" => "La base de données n'est pas accessible", "ERROR_DB_VERSION_MISMATCH" => "La base de donnée doit être mise à jour", "ERROR_TOO_MANY_MEMBERS" => "Ce salon a atteint sa limite de participants", + "ERROR_ESTABLISHING_P2P" => "Impossible d'établir une connexion avec un des participants", "JS_REQUIRED" => "VROOM nécessite l'activation du javascript", "EMAIL_INVITATION" => "Invitation à une conférence vidéo", "YOU_ARE_INVITED_TO_A_MEETING" => "Vous êtes attendu sur un salon de vidéo conférence. " . diff --git a/public/js/vroom.js b/public/js/vroom.js index 8d063f4..338bff8 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -1631,6 +1631,18 @@ function initVroom(room) { } }); + // Display an error if an error occures during p2p connection + function p2pFailure(peer){ + peer.end(); + $.notify(localize('ERROR_ESTABLISHING_P2P')); + } + webrtc.on('iceFailed', function(peer){ + p2pFailure(peer); + }); + webrtc.on('connectivityError', function(peer){ + p2pFailure(peer); + }); + // Detect connection lost webrtc.connection.socket.on('disconnect', function(){ setTimeout(function(){