Selaa lähdekoodia

Merge pull request #640 from jitsi/fix-recorder-states

Fix recorder state and moderator restart
master
Paweł Domas 9 vuotta sitten
vanhempi
commit
b191c58462
2 muutettua tiedostoa jossa 19 lisäystä ja 7 poistoa
  1. 12
    0
      conference.js
  2. 7
    7
      modules/UI/recording/Recording.js

+ 12
- 0
conference.js Näytä tiedosto

@@ -460,6 +460,18 @@ export default {
460 460
         return this._room
461 461
             && this._room.myUserId();
462 462
     },
463
+    /**
464
+     * Indicates if recording is supported in this conference.
465
+     */
466
+    isRecordingSupported() {
467
+        return this._room && this._room.isRecordingSupported();
468
+    },
469
+    /**
470
+     * Returns the recording state or undefined if the room is not defined.
471
+     */
472
+    getRecordingState() {
473
+        return (this._room) ? this._room.getRecordingState() : undefined;
474
+    },
463 475
     /**
464 476
      * Will be filled with values only when config.debug is enabled.
465 477
      * Its used by torture to check audio levels.

+ 7
- 7
modules/UI/recording/Recording.js Näytä tiedosto

@@ -30,7 +30,7 @@ import BottomToolbar from '../toolbars/BottomToolbar';
30 30
  */
31 31
 function _isRecordingButtonEnabled() {
32 32
     return interfaceConfig.TOOLBAR_BUTTONS.indexOf("recording") !== -1
33
-            && config.enableRecording;
33
+            && config.enableRecording && APP.conference.isRecordingSupported();
34 34
 }
35 35
 
36 36
 /**
@@ -211,7 +211,7 @@ var Status = {
211 211
 /**
212 212
  * Manages the recording user interface and user experience.
213 213
  * @type {{init, initRecordingButton, showRecordingButton, updateRecordingState,
214
- * setRecordingButtonState, checkAutoRecord}}
214
+ * updateRecordingUI, checkAutoRecord}}
215 215
  */
216 216
 var Recording = {
217 217
     /**
@@ -219,8 +219,8 @@ var Recording = {
219 219
      */
220 220
     init (emitter, recordingType) {
221 221
         this.eventEmitter = emitter;
222
-        // Use recorder states directly from the library.
223
-        this.currentState = Status.UNAVAILABLE;
222
+
223
+        this.updateRecordingState(APP.conference.getRecordingState());
224 224
 
225 225
         this.initRecordingButton(recordingType);
226 226
 
@@ -326,17 +326,17 @@ var Recording = {
326 326
             return;
327 327
 
328 328
         // If there's no state change, we ignore the update.
329
-        if (this.currentState === recordingState)
329
+        if (!recordingState || this.currentState === recordingState)
330 330
             return;
331 331
 
332
-        this.setRecordingButtonState(recordingState);
332
+        this.updateRecordingUI(recordingState);
333 333
     },
334 334
 
335 335
     /**
336 336
      * Sets the state of the recording button.
337 337
      * @param recordingState gives us the current recording state
338 338
      */
339
-    setRecordingButtonState (recordingState) {
339
+    updateRecordingUI (recordingState) {
340 340
         let buttonSelector = $('#toolbar_button_record');
341 341
         let labelSelector = $('#recordingLabel');
342 342
 

Loading…
Peruuta
Tallenna