瀏覽代碼

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
         if(JitsiMeetJS.getGlobalOnErrorHandler){
356
         if(JitsiMeetJS.getGlobalOnErrorHandler){
357
             var oldOnErrorHandler = window.onerror;
357
             var oldOnErrorHandler = window.onerror;
358
             window.onerror = function (message, source, lineno, colno, error) {
358
             window.onerror = function (message, source, lineno, colno, error) {
359
-
360
                 JitsiMeetJS.getGlobalOnErrorHandler(
359
                 JitsiMeetJS.getGlobalOnErrorHandler(
361
                     message, source, lineno, colno, error);
360
                     message, source, lineno, colno, error);
362
 
361
 

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

275
         "off": "Recording stopped",
275
         "off": "Recording stopped",
276
         "failedToStart": "Recording failed to start",
276
         "failedToStart": "Recording failed to start",
277
         "buttonTooltip": "Start / stop recording",
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
     "liveStreaming":
281
     "liveStreaming":
281
     {
282
     {
286
         "failedToStart": "Live streaming failed to start",
287
         "failedToStart": "Live streaming failed to start",
287
         "buttonTooltip": "Start / stop live stream",
288
         "buttonTooltip": "Start / stop live stream",
288
         "streamIdRequired": "Please fill in the stream id in order to launch the live streaming.",
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
     AVAILABLE: "available",
206
     AVAILABLE: "available",
207
     UNAVAILABLE: "unavailable",
207
     UNAVAILABLE: "unavailable",
208
     PENDING: "pending",
208
     PENDING: "pending",
209
-    ERROR: "error"
209
+    ERROR: "error",
210
+    FAILED: "failed",
211
+    BUSY: "busy"
210
 };
212
 };
211
 
213
 
212
 /**
214
 /**
245
 
247
 
246
         if (recordingType === 'jibri') {
248
         if (recordingType === 'jibri') {
247
             this.baseClass = "fa fa-play-circle";
249
             this.baseClass = "fa fa-play-circle";
250
+            this.recordingTitle = "dialog.liveStreaming";
248
             this.recordingOnKey = "liveStreaming.on";
251
             this.recordingOnKey = "liveStreaming.on";
249
             this.recordingOffKey = "liveStreaming.off";
252
             this.recordingOffKey = "liveStreaming.off";
250
             this.recordingPendingKey = "liveStreaming.pending";
253
             this.recordingPendingKey = "liveStreaming.pending";
251
             this.failedToStartKey = "liveStreaming.failedToStart";
254
             this.failedToStartKey = "liveStreaming.failedToStart";
252
             this.recordingErrorKey = "liveStreaming.error";
255
             this.recordingErrorKey = "liveStreaming.error";
253
             this.recordingButtonTooltip = "liveStreaming.buttonTooltip";
256
             this.recordingButtonTooltip = "liveStreaming.buttonTooltip";
257
+            this.recordingUnavailable = "liveStreaming.unavailable";
258
+            this.recordingBusy = "liveStreaming.busy";
254
         }
259
         }
255
         else {
260
         else {
256
             this.baseClass = "icon-recEnable";
261
             this.baseClass = "icon-recEnable";
262
+            this.recordingTitle = "dialog.recording";
257
             this.recordingOnKey = "recording.on";
263
             this.recordingOnKey = "recording.on";
258
             this.recordingOffKey = "recording.off";
264
             this.recordingOffKey = "recording.off";
259
             this.recordingPendingKey = "recording.pending";
265
             this.recordingPendingKey = "recording.pending";
260
             this.failedToStartKey = "recording.failedToStart";
266
             this.failedToStartKey = "recording.failedToStart";
261
             this.recordingErrorKey = "recording.error";
267
             this.recordingErrorKey = "recording.error";
262
             this.recordingButtonTooltip = "recording.buttonTooltip";
268
             this.recordingButtonTooltip = "recording.buttonTooltip";
269
+            this.recordingUnavailable = "recording.unavailable";
270
+            this.recordingBusy = "liveStreaming.busy";
263
         }
271
         }
264
 
272
 
265
         selector.addClass(this.baseClass);
273
         selector.addClass(this.baseClass);
307
                     }
315
                     }
308
                     break;
316
                     break;
309
                 }
317
                 }
318
+                case Status.BUSY: {
319
+                    APP.UI.messageHandler.openMessageDialog(
320
+                        self.recordingTitle,
321
+                        self.recordingBusy
322
+                    );
323
+                    break;
324
+                }
310
                 default: {
325
                 default: {
311
                     APP.UI.messageHandler.openMessageDialog(
326
                     APP.UI.messageHandler.openMessageDialog(
312
-                        "dialog.liveStreaming",
313
-                        "liveStreaming.unavailable"
327
+                        self.recordingTitle,
328
+                        self.recordingUnavailable
314
                     );
329
                     );
315
                 }
330
                 }
316
             }
331
             }
352
     updateRecordingUI (recordingState) {
367
     updateRecordingUI (recordingState) {
353
         let buttonSelector = $('#toolbar_button_record');
368
         let buttonSelector = $('#toolbar_button_record');
354
 
369
 
370
+        let oldState = this.currentState;
371
+        this.currentState = recordingState;
372
+
355
         // TODO: handle recording state=available
373
         // TODO: handle recording state=available
356
         if (recordingState === Status.ON) {
374
         if (recordingState === Status.ON) {
357
 
375
 
361
             this._updateStatusLabel(this.recordingOnKey, false);
379
             this._updateStatusLabel(this.recordingOnKey, false);
362
         }
380
         }
363
         else if (recordingState === Status.OFF
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
             // We don't want to do any changes if this is
386
             // We don't want to do any changes if this is
367
             // an availability change.
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
                 return;
390
                 return;
371
 
391
 
372
             buttonSelector.removeClass(this.baseClass + " active");
392
             buttonSelector.removeClass(this.baseClass + " active");
373
             buttonSelector.addClass(this.baseClass);
393
             buttonSelector.addClass(this.baseClass);
374
 
394
 
375
             let messageKey;
395
             let messageKey;
376
-            if (this.currentState === Status.PENDING)
396
+            if (oldState === Status.PENDING)
377
                 messageKey = this.failedToStartKey;
397
                 messageKey = this.failedToStartKey;
378
             else
398
             else
379
                 messageKey = this.recordingOffKey;
399
                 messageKey = this.recordingOffKey;
391
 
411
 
392
             this._updateStatusLabel(this.recordingPendingKey, true);
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
             buttonSelector.removeClass(this.baseClass + " active");
416
             buttonSelector.removeClass(this.baseClass + " active");
396
             buttonSelector.addClass(this.baseClass);
417
             buttonSelector.addClass(this.baseClass);
397
 
418
 
398
             this._updateStatusLabel(this.recordingErrorKey, true);
419
             this._updateStatusLabel(this.recordingErrorKey, true);
399
         }
420
         }
400
 
421
 
401
-        this.currentState = recordingState;
402
-
403
         let labelSelector = $('#recordingLabel');
422
         let labelSelector = $('#recordingLabel');
404
 
423
 
405
         // We don't show the label for available state.
424
         // We don't show the label for available state.

Loading…
取消
儲存