瀏覽代碼

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.
master
paweldomas 8 年之前
父節點
當前提交
229a3b4418
共有 3 個檔案被更改,包括 14 行新增17 行删除
  1. 9
    5
      conference.js
  2. 1
    2
      lang/main.json
  3. 4
    10
      modules/UI/UI.js

+ 9
- 5
conference.js 查看文件

@@ -329,10 +329,6 @@ class ConferenceConnector {
329 329
             }
330 330
             break;
331 331
 
332
-        case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
333
-            APP.UI.notifyBridgeDown();
334
-            break;
335
-
336 332
             // not enough rights to create conference
337 333
         case ConferenceErrors.AUTHENTICATION_REQUIRED:
338 334
             // schedule reconnect to check if someone else created the room
@@ -367,6 +363,10 @@ class ConferenceConnector {
367 363
             }
368 364
             break;
369 365
 
366
+            // FIXME FOCUS_DISCONNECTED is confusing event name.
367
+            // What really happens there is that the library is not ready yet,
368
+            // because Jicofo is not available, but it is going to give
369
+            // it another try.
370 370
         case ConferenceErrors.FOCUS_DISCONNECTED:
371 371
             {
372 372
                 let [focus, retrySec] = params;
@@ -375,8 +375,12 @@ class ConferenceConnector {
375 375
             break;
376 376
 
377 377
         case ConferenceErrors.FOCUS_LEFT:
378
+        case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
379
+            // FIXME the conference should be stopped by the library and not by
380
+            // the app. Both the errors above are unrecoverable from the library
381
+            // perspective.
378 382
             room.leave().then(() => connection.disconnect());
379
-            APP.UI.notifyFocusLeft();
383
+            APP.UI.notifyVideoConferencingNotAvailable();
380 384
             break;
381 385
 
382 386
         case ConferenceErrors.CONFERENCE_MAX_USERS:

+ 1
- 2
lang/main.json 查看文件

@@ -202,8 +202,7 @@
202 202
         "detectext": "Error when trying to detect desktopsharing extension.",
203 203
         "failtoinstall": "Failed to install desktop sharing extension",
204 204
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
205
-        "bridgeUnavailable": "Jitsi Videobridge is currently unavailable. Please try again later!",
206
-        "jicofoUnavailable": "Jicofo is currently unavailable. Please try again later!",
205
+        "serviceUnavailableMsg": "The video conferencing service is currently unavailable. Please try again later!",
207 206
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
208 207
         "lockTitle": "Lock failed",
209 208
         "lockMessage": "Failed to lock the conference.",

+ 4
- 10
modules/UI/UI.js 查看文件

@@ -195,13 +195,6 @@ UI.notifyConferenceDestroyed = function (reason) {
195 195
     messageHandler.openDialog(title, reason, true, {}, () => false);
196 196
 };
197 197
 
198
-/**
199
- * Notify user that Jitsi Videobridge is not accessible.
200
- */
201
- UI.notifyBridgeDown = function () {
202
-    messageHandler.showError("dialog.error", "dialog.bridgeUnavailable");
203
-};
204
-
205 198
 /**
206 199
  * Show chat error.
207 200
  * @param err the Error
@@ -1114,14 +1107,15 @@ UI.notifyFocusDisconnected = function (focus, retrySec) {
1114 1107
 };
1115 1108
 
1116 1109
 /**
1117
- * Notify user that focus left the conference so page should be reloaded.
1110
+ * Notify the user that the video conferencing service is badly broken and
1111
+ * the page should be reloaded.
1118 1112
  */
1119
-UI.notifyFocusLeft = function () {
1113
+UI.notifyVideoConferencingNotAvailable = function () {
1120 1114
     let title = APP.translation.generateTranslationHTML(
1121 1115
         'dialog.serviceUnavailable'
1122 1116
     );
1123 1117
     let msg = APP.translation.generateTranslationHTML(
1124
-        'dialog.jicofoUnavailable'
1118
+        'dialog.serviceUnavailableMsg'
1125 1119
     );
1126 1120
     messageHandler.openDialog(
1127 1121
         title,

Loading…
取消
儲存