浏览代码

Merge pull request #670 from jitsi/handle-recording-errors

Handle recording errors
j8
hristoterezov 9 年前
父节点
当前提交
b8d8ef5cfd
共有 3 个文件被更改,包括 33 次插入13 次删除
  1. 0
    1
      conference.js
  2. 4
    2
      lang/main.json
  3. 29
    10
      modules/UI/recording/Recording.js

+ 0
- 1
conference.js 查看文件

@@ -356,7 +356,6 @@ export default {
356 356
         if(JitsiMeetJS.getGlobalOnErrorHandler){
357 357
             var oldOnErrorHandler = window.onerror;
358 358
             window.onerror = function (message, source, lineno, colno, error) {
359
-
360 359
                 JitsiMeetJS.getGlobalOnErrorHandler(
361 360
                     message, source, lineno, colno, error);
362 361
 

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

@@ -275,7 +275,8 @@
275 275
         "off": "Recording stopped",
276 276
         "failedToStart": "Recording failed to start",
277 277
         "buttonTooltip": "Start / stop recording",
278
-        "error": "Recording failed. Please try again."
278
+        "error": "Recording failed. Please try again.",
279
+        "unavailable": "The recording service is currently unavailable. Please try again later."
279 280
     },
280 281
     "liveStreaming":
281 282
     {
@@ -286,6 +287,7 @@
286 287
         "failedToStart": "Live streaming failed to start",
287 288
         "buttonTooltip": "Start / stop live stream",
288 289
         "streamIdRequired": "Please fill in the stream id in order to launch the live streaming.",
289
-        "error": "Live streaming failed. Please try again"
290
+        "error": "Live streaming failed. Please try again.",
291
+        "busy": "All recorders are currently busy. Please try again later."
290 292
     }
291 293
 }

+ 29
- 10
modules/UI/recording/Recording.js 查看文件

@@ -206,7 +206,9 @@ var Status = {
206 206
     AVAILABLE: "available",
207 207
     UNAVAILABLE: "unavailable",
208 208
     PENDING: "pending",
209
-    ERROR: "error"
209
+    ERROR: "error",
210
+    FAILED: "failed",
211
+    BUSY: "busy"
210 212
 };
211 213
 
212 214
 /**
@@ -245,21 +247,27 @@ var Recording = {
245 247
 
246 248
         if (recordingType === 'jibri') {
247 249
             this.baseClass = "fa fa-play-circle";
250
+            this.recordingTitle = "dialog.liveStreaming";
248 251
             this.recordingOnKey = "liveStreaming.on";
249 252
             this.recordingOffKey = "liveStreaming.off";
250 253
             this.recordingPendingKey = "liveStreaming.pending";
251 254
             this.failedToStartKey = "liveStreaming.failedToStart";
252 255
             this.recordingErrorKey = "liveStreaming.error";
253 256
             this.recordingButtonTooltip = "liveStreaming.buttonTooltip";
257
+            this.recordingUnavailable = "liveStreaming.unavailable";
258
+            this.recordingBusy = "liveStreaming.busy";
254 259
         }
255 260
         else {
256 261
             this.baseClass = "icon-recEnable";
262
+            this.recordingTitle = "dialog.recording";
257 263
             this.recordingOnKey = "recording.on";
258 264
             this.recordingOffKey = "recording.off";
259 265
             this.recordingPendingKey = "recording.pending";
260 266
             this.failedToStartKey = "recording.failedToStart";
261 267
             this.recordingErrorKey = "recording.error";
262 268
             this.recordingButtonTooltip = "recording.buttonTooltip";
269
+            this.recordingUnavailable = "recording.unavailable";
270
+            this.recordingBusy = "liveStreaming.busy";
263 271
         }
264 272
 
265 273
         selector.addClass(this.baseClass);
@@ -307,10 +315,17 @@ var Recording = {
307 315
                     }
308 316
                     break;
309 317
                 }
318
+                case Status.BUSY: {
319
+                    APP.UI.messageHandler.openMessageDialog(
320
+                        self.recordingTitle,
321
+                        self.recordingBusy
322
+                    );
323
+                    break;
324
+                }
310 325
                 default: {
311 326
                     APP.UI.messageHandler.openMessageDialog(
312
-                        "dialog.liveStreaming",
313
-                        "liveStreaming.unavailable"
327
+                        self.recordingTitle,
328
+                        self.recordingUnavailable
314 329
                     );
315 330
                 }
316 331
             }
@@ -352,6 +367,9 @@ var Recording = {
352 367
     updateRecordingUI (recordingState) {
353 368
         let buttonSelector = $('#toolbar_button_record');
354 369
 
370
+        let oldState = this.currentState;
371
+        this.currentState = recordingState;
372
+
355 373
         // TODO: handle recording state=available
356 374
         if (recordingState === Status.ON) {
357 375
 
@@ -361,19 +379,21 @@ var Recording = {
361 379
             this._updateStatusLabel(this.recordingOnKey, false);
362 380
         }
363 381
         else if (recordingState === Status.OFF
364
-                || recordingState === Status.UNAVAILABLE) {
382
+                || recordingState === Status.UNAVAILABLE
383
+                || recordingState === Status.BUSY
384
+                || recordingState === Status.FAILED) {
365 385
 
366 386
             // We don't want to do any changes if this is
367 387
             // an availability change.
368
-            if (this.currentState !== Status.ON
369
-                && this.currentState !== Status.PENDING)
388
+            if (oldState !== Status.ON
389
+                && oldState !== Status.PENDING)
370 390
                 return;
371 391
 
372 392
             buttonSelector.removeClass(this.baseClass + " active");
373 393
             buttonSelector.addClass(this.baseClass);
374 394
 
375 395
             let messageKey;
376
-            if (this.currentState === Status.PENDING)
396
+            if (oldState === Status.PENDING)
377 397
                 messageKey = this.failedToStartKey;
378 398
             else
379 399
                 messageKey = this.recordingOffKey;
@@ -391,15 +411,14 @@ var Recording = {
391 411
 
392 412
             this._updateStatusLabel(this.recordingPendingKey, true);
393 413
         }
394
-        else if (recordingState === Status.ERROR) {
414
+        else if (recordingState === Status.ERROR
415
+                    || recordingState === Status.FAILED) {
395 416
             buttonSelector.removeClass(this.baseClass + " active");
396 417
             buttonSelector.addClass(this.baseClass);
397 418
 
398 419
             this._updateStatusLabel(this.recordingErrorKey, true);
399 420
         }
400 421
 
401
-        this.currentState = recordingState;
402
-
403 422
         let labelSelector = $('#recordingLabel');
404 423
 
405 424
         // We don't show the label for available state.

正在加载...
取消
保存