|
@@ -221,11 +221,21 @@ var Status = {
|
221
|
221
|
AVAILABLE: "available",
|
222
|
222
|
UNAVAILABLE: "unavailable",
|
223
|
223
|
PENDING: "pending",
|
|
224
|
+ RETRYING: "retrying",
|
224
|
225
|
ERROR: "error",
|
225
|
226
|
FAILED: "failed",
|
226
|
227
|
BUSY: "busy"
|
227
|
228
|
};
|
228
|
229
|
|
|
230
|
+/**
|
|
231
|
+ * Checks whether if the given status is either PENDING or RETRYING
|
|
232
|
+ * @param status {Status} Jibri status to be checked
|
|
233
|
+ * @returns {boolean} true if the condition is met or false otherwise.
|
|
234
|
+ */
|
|
235
|
+function isStartingStatus(status) {
|
|
236
|
+ return status === Status.PENDING || status === Status.RETRYING;
|
|
237
|
+}
|
|
238
|
+
|
229
|
239
|
/**
|
230
|
240
|
* Manages the recording user interface and user experience.
|
231
|
241
|
* @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
|
|
@@ -299,6 +309,7 @@ var Recording = {
|
299
|
309
|
|
300
|
310
|
switch (self.currentState) {
|
301
|
311
|
case Status.ON:
|
|
312
|
+ case Status.RETRYING:
|
302
|
313
|
case Status.PENDING: {
|
303
|
314
|
_showStopRecordingPrompt(recordingType).then(() =>
|
304
|
315
|
self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED),
|
|
@@ -400,7 +411,8 @@ var Recording = {
|
400
|
411
|
this.currentState = recordingState;
|
401
|
412
|
|
402
|
413
|
// TODO: handle recording state=available
|
403
|
|
- if (recordingState === Status.ON) {
|
|
414
|
+ if (recordingState === Status.ON ||
|
|
415
|
+ recordingState === Status.RETRYING) {
|
404
|
416
|
|
405
|
417
|
buttonSelector.removeClass(this.baseClass);
|
406
|
418
|
buttonSelector.addClass(this.baseClass + " active");
|
|
@@ -415,14 +427,14 @@ var Recording = {
|
415
|
427
|
// We don't want to do any changes if this is
|
416
|
428
|
// an availability change.
|
417
|
429
|
if (oldState !== Status.ON
|
418
|
|
- && oldState !== Status.PENDING)
|
|
430
|
+ && !isStartingStatus(oldState))
|
419
|
431
|
return;
|
420
|
432
|
|
421
|
433
|
buttonSelector.removeClass(this.baseClass + " active");
|
422
|
434
|
buttonSelector.addClass(this.baseClass);
|
423
|
435
|
|
424
|
436
|
let messageKey;
|
425
|
|
- if (oldState === Status.PENDING)
|
|
437
|
+ if (isStartingStatus(oldState))
|
426
|
438
|
messageKey = this.failedToStartKey;
|
427
|
439
|
else
|
428
|
440
|
messageKey = this.recordingOffKey;
|
|
@@ -454,6 +466,12 @@ var Recording = {
|
454
|
466
|
if (recordingState !== Status.AVAILABLE
|
455
|
467
|
&& !labelSelector.is(":visible"))
|
456
|
468
|
labelSelector.css({display: "inline-block"});
|
|
469
|
+
|
|
470
|
+ // Recording spinner
|
|
471
|
+ if (recordingState === Status.RETRYING)
|
|
472
|
+ $("#recordingSpinner").show();
|
|
473
|
+ else
|
|
474
|
+ $("#recordingSpinner").hide();
|
457
|
475
|
},
|
458
|
476
|
// checks whether recording is enabled and whether we have params
|
459
|
477
|
// to start automatically recording
|
|
@@ -472,11 +490,12 @@ var Recording = {
|
472
|
490
|
*/
|
473
|
491
|
_updateStatusLabel(textKey, isCentered) {
|
474
|
492
|
let labelSelector = $('#recordingLabel');
|
|
493
|
+ let labelTextSelector = $('#recordingLabelText');
|
475
|
494
|
|
476
|
495
|
moveToCorner(labelSelector, !isCentered);
|
477
|
496
|
|
478
|
|
- labelSelector.attr("data-i18n", textKey);
|
479
|
|
- labelSelector.text(APP.translation.translateString(textKey));
|
|
497
|
+ labelTextSelector.attr("data-i18n", textKey);
|
|
498
|
+ labelTextSelector.text(APP.translation.translateString(textKey));
|
480
|
499
|
}
|
481
|
500
|
};
|
482
|
501
|
|