瀏覽代碼

Display spinner for RETRYING recording status

j8
paweldomas 8 年之前
父節點
當前提交
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,7 +3,7 @@ BROWSERIFY = ./node_modules/.bin/browserify
3 3
 UGLIFYJS = ./node_modules/.bin/uglifyjs
4 4
 EXORCIST = ./node_modules/.bin/exorcist
5 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 7
 DEPLOY_DIR = libs
8 8
 BROWSERIFY_FLAGS = -d
9 9
 OUTPUT_DIR = .

+ 4
- 0
css/recording.css 查看文件

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

+ 2
- 0
images/spin.svg 查看文件

@@ -0,0 +1,2 @@
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,7 +174,10 @@
174 174
                 </div>
175 175
                 <span id="videoConnectionMessage"></span>
176 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 181
             </div>
179 182
 
180 183
             <div id="remoteVideos">

+ 24
- 5
modules/UI/recording/Recording.js 查看文件

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

Loading…
取消
儲存