Просмотр исходного кода

Display spinner for RETRYING recording status

j8
paweldomas 8 лет назад
Родитель
Сommit
62dd54ab31
5 измененных файлов: 35 добавлений и 7 удалений
  1. 1
    1
      Makefile
  2. 4
    0
      css/recording.css
  3. 2
    0
      images/spin.svg
  4. 4
    1
      index.html
  5. 24
    5
      modules/UI/recording/Recording.js

+ 1
- 1
Makefile Просмотреть файл

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 Просмотреть файл

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

+ 2
- 0
images/spin.svg Просмотреть файл

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 Просмотреть файл

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">

+ 24
- 5
modules/UI/recording/Recording.js Просмотреть файл

221
     AVAILABLE: "available",
221
     AVAILABLE: "available",
222
     UNAVAILABLE: "unavailable",
222
     UNAVAILABLE: "unavailable",
223
     PENDING: "pending",
223
     PENDING: "pending",
224
+    RETRYING: "retrying",
224
     ERROR: "error",
225
     ERROR: "error",
225
     FAILED: "failed",
226
     FAILED: "failed",
226
     BUSY: "busy"
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
  * Manages the recording user interface and user experience.
240
  * Manages the recording user interface and user experience.
231
  * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
241
  * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
299
 
309
 
300
             switch (self.currentState) {
310
             switch (self.currentState) {
301
                 case Status.ON:
311
                 case Status.ON:
312
+                case Status.RETRYING:
302
                 case Status.PENDING: {
313
                 case Status.PENDING: {
303
                     _showStopRecordingPrompt(recordingType).then(() =>
314
                     _showStopRecordingPrompt(recordingType).then(() =>
304
                         self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED),
315
                         self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED),
400
         this.currentState = recordingState;
411
         this.currentState = recordingState;
401
 
412
 
402
         // TODO: handle recording state=available
413
         // TODO: handle recording state=available
403
-        if (recordingState === Status.ON) {
414
+        if (recordingState === Status.ON ||
415
+            recordingState === Status.RETRYING) {
404
 
416
 
405
             buttonSelector.removeClass(this.baseClass);
417
             buttonSelector.removeClass(this.baseClass);
406
             buttonSelector.addClass(this.baseClass + " active");
418
             buttonSelector.addClass(this.baseClass + " active");
415
             // We don't want to do any changes if this is
427
             // We don't want to do any changes if this is
416
             // an availability change.
428
             // an availability change.
417
             if (oldState !== Status.ON
429
             if (oldState !== Status.ON
418
-                && oldState !== Status.PENDING)
430
+                && !isStartingStatus(oldState))
419
                 return;
431
                 return;
420
 
432
 
421
             buttonSelector.removeClass(this.baseClass + " active");
433
             buttonSelector.removeClass(this.baseClass + " active");
422
             buttonSelector.addClass(this.baseClass);
434
             buttonSelector.addClass(this.baseClass);
423
 
435
 
424
             let messageKey;
436
             let messageKey;
425
-            if (oldState === Status.PENDING)
437
+            if (isStartingStatus(oldState))
426
                 messageKey = this.failedToStartKey;
438
                 messageKey = this.failedToStartKey;
427
             else
439
             else
428
                 messageKey = this.recordingOffKey;
440
                 messageKey = this.recordingOffKey;
454
         if (recordingState !== Status.AVAILABLE
466
         if (recordingState !== Status.AVAILABLE
455
             && !labelSelector.is(":visible"))
467
             && !labelSelector.is(":visible"))
456
             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();
457
     },
475
     },
458
     // checks whether recording is enabled and whether we have params
476
     // checks whether recording is enabled and whether we have params
459
     // to start automatically recording
477
     // to start automatically recording
472
      */
490
      */
473
     _updateStatusLabel(textKey, isCentered) {
491
     _updateStatusLabel(textKey, isCentered) {
474
         let labelSelector = $('#recordingLabel');
492
         let labelSelector = $('#recordingLabel');
493
+        let labelTextSelector = $('#recordingLabelText');
475
 
494
 
476
         moveToCorner(labelSelector, !isCentered);
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
 

Загрузка…
Отмена
Сохранить