Sfoglia il codice sorgente

Merge pull request #719 from jitsi/jibri-retries

Jibri retries
master
bgrozev 9 anni fa
parent
commit
d2a6c4a97f
5 ha cambiato i file con 38 aggiunte e 9 eliminazioni
  1. 1
    1
      Makefile
  2. 4
    0
      css/recording.css
  3. 2
    0
      images/spin.svg
  4. 4
    1
      index.html
  5. 27
    7
      modules/UI/recording/Recording.js

+ 1
- 1
Makefile Vedi File

3
 UGLIFYJS = ./node_modules/.bin/uglifyjs
3
 UGLIFYJS = ./node_modules/.bin/uglifyjs
4
 EXORCIST = ./node_modules/.bin/exorcist
4
 EXORCIST = ./node_modules/.bin/exorcist
5
 CLEANCSS = ./node_modules/.bin/cleancss
5
 CLEANCSS = ./node_modules/.bin/cleancss
6
-CSS_FILES = font.css toastr.css main.css overlay.css videolayout_default.css font-awesome.css jquery-impromptu.css modaldialog.css notice.css popup_menu.css login_menu.css popover.css jitsi_popover.css contact_list.css chat.css welcome_page.css settingsmenu.css feedback.css jquery.contextMenu.css keyboard-shortcuts.css
6
+CSS_FILES = font.css toastr.css main.css overlay.css videolayout_default.css font-awesome.css jquery-impromptu.css modaldialog.css notice.css popup_menu.css recording.css login_menu.css popover.css jitsi_popover.css contact_list.css chat.css welcome_page.css settingsmenu.css feedback.css jquery.contextMenu.css keyboard-shortcuts.css
7
 DEPLOY_DIR = libs
7
 DEPLOY_DIR = libs
8
 BROWSERIFY_FLAGS = -d
8
 BROWSERIFY_FLAGS = -d
9
 OUTPUT_DIR = .
9
 OUTPUT_DIR = .

+ 4
- 0
css/recording.css Vedi File

1
+.recordingSpinner {
2
+    display: none;
3
+    vertical-align: text-bottom;
4
+}

+ 2
- 0
images/spin.svg Vedi File

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<svg width='20px' height='20px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-spin"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><g transform="translate(50 50)"><g transform="rotate(0) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(45) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.12s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.12s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(90) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.25s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.25s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(135) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.37s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.37s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(180) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.5s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.5s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(225) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.62s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.62s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(270) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.75s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.75s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g><g transform="rotate(315) translate(34 0)"><circle cx="0" cy="0" r="8" fill="#ffffff"><animate attributeName="opacity" from="1" to="0.1" begin="0.87s" dur="1s" repeatCount="indefinite"></animate><animateTransform attributeName="transform" type="scale" from="1.5" to="1" begin="0.87s" dur="1s" repeatCount="indefinite"></animateTransform></circle></g></g></svg>

+ 4
- 1
index.html Vedi File

174
                 </div>
174
                 </div>
175
                 <span id="videoConnectionMessage"></span>
175
                 <span id="videoConnectionMessage"></span>
176
                 <span id="videoResolutionLabel">HD</span>
176
                 <span id="videoResolutionLabel">HD</span>
177
-                <span id="recordingLabel" class="centeredVideoLabel"></span>
177
+                <span id="recordingLabel" class="centeredVideoLabel">
178
+                    <span id="recordingLabelText"></span>
179
+                    <img id="recordingSpinner" class="recordingSpinner" src="images/spin.svg"></img>
180
+                </span>
178
             </div>
181
             </div>
179
 
182
 
180
             <div id="remoteVideos">
183
             <div id="remoteVideos">

+ 27
- 7
modules/UI/recording/Recording.js Vedi File

201
  */
201
  */
202
 function moveToCorner(selector, move) {
202
 function moveToCorner(selector, move) {
203
     let moveToCornerClass = "moveToCorner";
203
     let moveToCornerClass = "moveToCorner";
204
+    let containsClass = selector.hasClass(moveToCornerClass);
204
 
205
 
205
-    if (move && !selector.hasClass(moveToCornerClass))
206
+    if (move && !containsClass)
206
         selector.addClass(moveToCornerClass);
207
         selector.addClass(moveToCornerClass);
207
-    else
208
+    else if (!move && containsClass)
208
         selector.removeClass(moveToCornerClass);
209
         selector.removeClass(moveToCornerClass);
209
 }
210
 }
210
 
211
 
220
     AVAILABLE: "available",
221
     AVAILABLE: "available",
221
     UNAVAILABLE: "unavailable",
222
     UNAVAILABLE: "unavailable",
222
     PENDING: "pending",
223
     PENDING: "pending",
224
+    RETRYING: "retrying",
223
     ERROR: "error",
225
     ERROR: "error",
224
     FAILED: "failed",
226
     FAILED: "failed",
225
     BUSY: "busy"
227
     BUSY: "busy"
226
 };
228
 };
227
 
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
+
228
 /**
239
 /**
229
  * Manages the recording user interface and user experience.
240
  * Manages the recording user interface and user experience.
230
  * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
241
  * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
298
 
309
 
299
             switch (self.currentState) {
310
             switch (self.currentState) {
300
                 case Status.ON:
311
                 case Status.ON:
312
+                case Status.RETRYING:
301
                 case Status.PENDING: {
313
                 case Status.PENDING: {
302
                     _showStopRecordingPrompt(recordingType).then(() =>
314
                     _showStopRecordingPrompt(recordingType).then(() =>
303
                         self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED),
315
                         self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED),
399
         this.currentState = recordingState;
411
         this.currentState = recordingState;
400
 
412
 
401
         // TODO: handle recording state=available
413
         // TODO: handle recording state=available
402
-        if (recordingState === Status.ON) {
414
+        if (recordingState === Status.ON ||
415
+            recordingState === Status.RETRYING) {
403
 
416
 
404
             buttonSelector.removeClass(this.baseClass);
417
             buttonSelector.removeClass(this.baseClass);
405
             buttonSelector.addClass(this.baseClass + " active");
418
             buttonSelector.addClass(this.baseClass + " active");
414
             // We don't want to do any changes if this is
427
             // We don't want to do any changes if this is
415
             // an availability change.
428
             // an availability change.
416
             if (oldState !== Status.ON
429
             if (oldState !== Status.ON
417
-                && oldState !== Status.PENDING)
430
+                && !isStartingStatus(oldState))
418
                 return;
431
                 return;
419
 
432
 
420
             buttonSelector.removeClass(this.baseClass + " active");
433
             buttonSelector.removeClass(this.baseClass + " active");
421
             buttonSelector.addClass(this.baseClass);
434
             buttonSelector.addClass(this.baseClass);
422
 
435
 
423
             let messageKey;
436
             let messageKey;
424
-            if (oldState === Status.PENDING)
437
+            if (isStartingStatus(oldState))
425
                 messageKey = this.failedToStartKey;
438
                 messageKey = this.failedToStartKey;
426
             else
439
             else
427
                 messageKey = this.recordingOffKey;
440
                 messageKey = this.recordingOffKey;
453
         if (recordingState !== Status.AVAILABLE
466
         if (recordingState !== Status.AVAILABLE
454
             && !labelSelector.is(":visible"))
467
             && !labelSelector.is(":visible"))
455
             labelSelector.css({display: "inline-block"});
468
             labelSelector.css({display: "inline-block"});
469
+
470
+        // Recording spinner
471
+        if (recordingState === Status.RETRYING)
472
+            $("#recordingSpinner").show();
473
+        else
474
+            $("#recordingSpinner").hide();
456
     },
475
     },
457
     // checks whether recording is enabled and whether we have params
476
     // checks whether recording is enabled and whether we have params
458
     // to start automatically recording
477
     // to start automatically recording
471
      */
490
      */
472
     _updateStatusLabel(textKey, isCentered) {
491
     _updateStatusLabel(textKey, isCentered) {
473
         let labelSelector = $('#recordingLabel');
492
         let labelSelector = $('#recordingLabel');
493
+        let labelTextSelector = $('#recordingLabelText');
474
 
494
 
475
         moveToCorner(labelSelector, !isCentered);
495
         moveToCorner(labelSelector, !isCentered);
476
 
496
 
477
-        labelSelector.attr("data-i18n", textKey);
478
-        labelSelector.text(APP.translation.translateString(textKey));
497
+        labelTextSelector.attr("data-i18n", textKey);
498
+        labelTextSelector.text(APP.translation.translateString(textKey));
479
     }
499
     }
480
 };
500
 };
481
 
501
 

Loading…
Annulla
Salva