From 229a3b4418947bdb5ae0ab64686e1ff9e65bf3f1 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Thu, 6 Oct 2016 13:30:00 -0500 Subject: [PATCH] fix(conference): disconnect on VIDEOBRIDGE_NOT_AVAILABLE error Will disconnect on ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE. Show the same message when either JVB is not available or Jicofo disconnects. --- conference.js | 14 +++++++++----- lang/main.json | 3 +-- modules/UI/UI.js | 14 ++++---------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/conference.js b/conference.js index cd2eef4c2..00c129799 100644 --- a/conference.js +++ b/conference.js @@ -329,10 +329,6 @@ class ConferenceConnector { } break; - case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE: - APP.UI.notifyBridgeDown(); - break; - // not enough rights to create conference case ConferenceErrors.AUTHENTICATION_REQUIRED: // schedule reconnect to check if someone else created the room @@ -367,6 +363,10 @@ class ConferenceConnector { } break; + // FIXME FOCUS_DISCONNECTED is confusing event name. + // What really happens there is that the library is not ready yet, + // because Jicofo is not available, but it is going to give + // it another try. case ConferenceErrors.FOCUS_DISCONNECTED: { let [focus, retrySec] = params; @@ -375,8 +375,12 @@ class ConferenceConnector { break; case ConferenceErrors.FOCUS_LEFT: + case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE: + // FIXME the conference should be stopped by the library and not by + // the app. Both the errors above are unrecoverable from the library + // perspective. room.leave().then(() => connection.disconnect()); - APP.UI.notifyFocusLeft(); + APP.UI.notifyVideoConferencingNotAvailable(); break; case ConferenceErrors.CONFERENCE_MAX_USERS: diff --git a/lang/main.json b/lang/main.json index 0c6d1ac73..7600f1539 100644 --- a/lang/main.json +++ b/lang/main.json @@ -202,8 +202,7 @@ "detectext": "Error when trying to detect desktopsharing extension.", "failtoinstall": "Failed to install desktop sharing extension", "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.", - "bridgeUnavailable": "Jitsi Videobridge is currently unavailable. Please try again later!", - "jicofoUnavailable": "Jicofo is currently unavailable. Please try again later!", + "serviceUnavailableMsg": "The video conferencing service is currently unavailable. Please try again later!", "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!", "lockTitle": "Lock failed", "lockMessage": "Failed to lock the conference.", diff --git a/modules/UI/UI.js b/modules/UI/UI.js index a8f542d01..a2b6d1f73 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -195,13 +195,6 @@ UI.notifyConferenceDestroyed = function (reason) { messageHandler.openDialog(title, reason, true, {}, () => false); }; -/** - * Notify user that Jitsi Videobridge is not accessible. - */ - UI.notifyBridgeDown = function () { - messageHandler.showError("dialog.error", "dialog.bridgeUnavailable"); -}; - /** * Show chat error. * @param err the Error @@ -1114,14 +1107,15 @@ UI.notifyFocusDisconnected = function (focus, retrySec) { }; /** - * Notify user that focus left the conference so page should be reloaded. + * Notify the user that the video conferencing service is badly broken and + * the page should be reloaded. */ -UI.notifyFocusLeft = function () { +UI.notifyVideoConferencingNotAvailable = function () { let title = APP.translation.generateTranslationHTML( 'dialog.serviceUnavailable' ); let msg = APP.translation.generateTranslationHTML( - 'dialog.jicofoUnavailable' + 'dialog.serviceUnavailableMsg' ); messageHandler.openDialog( title,