浏览代码

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
             }
329
             }
330
             break;
330
             break;
331
 
331
 
332
-        case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
333
-            APP.UI.notifyBridgeDown();
334
-            break;
335
-
336
             // not enough rights to create conference
332
             // not enough rights to create conference
337
         case ConferenceErrors.AUTHENTICATION_REQUIRED:
333
         case ConferenceErrors.AUTHENTICATION_REQUIRED:
338
             // schedule reconnect to check if someone else created the room
334
             // schedule reconnect to check if someone else created the room
367
             }
363
             }
368
             break;
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
         case ConferenceErrors.FOCUS_DISCONNECTED:
370
         case ConferenceErrors.FOCUS_DISCONNECTED:
371
             {
371
             {
372
                 let [focus, retrySec] = params;
372
                 let [focus, retrySec] = params;
375
             break;
375
             break;
376
 
376
 
377
         case ConferenceErrors.FOCUS_LEFT:
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
             room.leave().then(() => connection.disconnect());
382
             room.leave().then(() => connection.disconnect());
379
-            APP.UI.notifyFocusLeft();
383
+            APP.UI.notifyVideoConferencingNotAvailable();
380
             break;
384
             break;
381
 
385
 
382
         case ConferenceErrors.CONFERENCE_MAX_USERS:
386
         case ConferenceErrors.CONFERENCE_MAX_USERS:

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

202
         "detectext": "Error when trying to detect desktopsharing extension.",
202
         "detectext": "Error when trying to detect desktopsharing extension.",
203
         "failtoinstall": "Failed to install desktop sharing extension",
203
         "failtoinstall": "Failed to install desktop sharing extension",
204
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
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
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
206
         "maxUsersLimitReached": "The limit for maximum number of participants in the conference has been reached. The conference is full. Please try again later!",
208
         "lockTitle": "Lock failed",
207
         "lockTitle": "Lock failed",
209
         "lockMessage": "Failed to lock the conference.",
208
         "lockMessage": "Failed to lock the conference.",

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

195
     messageHandler.openDialog(title, reason, true, {}, () => false);
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
  * Show chat error.
199
  * Show chat error.
207
  * @param err the Error
200
  * @param err the Error
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
     let title = APP.translation.generateTranslationHTML(
1114
     let title = APP.translation.generateTranslationHTML(
1121
         'dialog.serviceUnavailable'
1115
         'dialog.serviceUnavailable'
1122
     );
1116
     );
1123
     let msg = APP.translation.generateTranslationHTML(
1117
     let msg = APP.translation.generateTranslationHTML(
1124
-        'dialog.jicofoUnavailable'
1118
+        'dialog.serviceUnavailableMsg'
1125
     );
1119
     );
1126
     messageHandler.openDialog(
1120
     messageHandler.openDialog(
1127
         title,
1121
         title,

正在加载...
取消
保存