Procházet zdrojové kódy

fix(Thumbnail): Improve naming.

master
Hristo Terezov před 4 roky
rodič
revize
e990f6984a

+ 6
- 5
react/features/base/media/components/web/AudioTrack.js Zobrazit soubor

@@ -35,9 +35,10 @@ type Props = {
35 35
     volume: ?number,
36 36
 
37 37
     /**
38
-     * A function that will be executed when the reference to the underlying audio element changes.
38
+     * A function that will be executed when the reference to the underlying audio element changes in order to report
39
+     * the initial volume value.
39 40
      */
40
-    onAudioElementReferenceChanged: Function
41
+    onInitialVolumeSet: Function
41 42
 };
42 43
 
43 44
 /**
@@ -207,10 +208,10 @@ export default class AudioTrack extends Component<Props> {
207 208
      */
208 209
     _setRef(audioElement: ?HTMLAudioElement) {
209 210
         this._ref = audioElement;
210
-        const { onAudioElementReferenceChanged } = this.props;
211
+        const { onInitialVolumeSet } = this.props;
211 212
 
212
-        if (this._ref && onAudioElementReferenceChanged) {
213
-            onAudioElementReferenceChanged({ volume: this._ref.volume });
213
+        if (this._ref && onInitialVolumeSet) {
214
+            onInitialVolumeSet(this._ref.volume);
214 215
         }
215 216
     }
216 217
 }

+ 10
- 10
react/features/filmstrip/components/web/Thumbnail.js Zobrazit soubor

@@ -162,7 +162,7 @@ class Thumbnail extends Component<Props, State> {
162 162
 
163 163
         this._updateAudioLevel = this._updateAudioLevel.bind(this);
164 164
         this._onVolumeChange = this._onVolumeChange.bind(this);
165
-        this._onAudioElementReferenceChanged = this._onAudioElementReferenceChanged.bind(this);
165
+        this._onInitialVolumeSet = this._onInitialVolumeSet.bind(this);
166 166
     }
167 167
 
168 168
     /**
@@ -308,11 +308,11 @@ class Thumbnail extends Component<Props, State> {
308 308
     }
309 309
 
310 310
     /**
311
-     * Renders the top toolbar of the thumbnail.
311
+     * Renders the top indicators of the thumbnail.
312 312
      *
313 313
      * @returns {Component}
314 314
      */
315
-    _renderTopToolbar() {
315
+    _renderTopIndicators() {
316 316
         const {
317 317
             _connectionIndicatorAutoHideEnabled,
318 318
             _connectionIndicatorDisabled,
@@ -416,7 +416,7 @@ class Thumbnail extends Component<Props, State> {
416 416
                     <StatusIndicators participantID = { id } />
417 417
                 </div>
418 418
                 <div className = 'videocontainer__toptoolbar'>
419
-                    { this._renderTopToolbar() }
419
+                    { this._renderTopIndicators() }
420 420
                 </div>
421 421
                 <div className = 'videocontainer__hoverOverlay' />
422 422
                 <div className = 'displayNameContainer'>
@@ -462,14 +462,14 @@ class Thumbnail extends Component<Props, State> {
462 462
                             audioTrack = { _audioTrack }
463 463
                             id = { `remoteAudio_${audioTrackId || ''}` }
464 464
                             muted = { _startSilent }
465
-                            onAudioElementReferenceChanged = { this._onAudioElementReferenceChanged }
465
+                            onInitialVolumeSet = { this._onInitialVolumeSet }
466 466
                             volume = { this.state.volume } />
467 467
                         : null
468 468
 
469 469
                 }
470 470
                 <div className = 'videocontainer__background' />
471 471
                 <div className = 'videocontainer__toptoolbar'>
472
-                    { this._renderTopToolbar() }
472
+                    { this._renderTopIndicators() }
473 473
                 </div>
474 474
                 <div className = 'videocontainer__toolbar'>
475 475
                     <StatusIndicators participantID = { id } />
@@ -501,15 +501,15 @@ class Thumbnail extends Component<Props, State> {
501 501
         );
502 502
     }
503 503
 
504
-    _onAudioElementReferenceChanged: Object => void;
504
+    _onInitialVolumeSet: Object => void;
505 505
 
506 506
     /**
507
-     * Handles audio element references changes by receiving some properties from the audio element.
507
+     * A handler for the initial volume value of the audio element.
508 508
      *
509
-     * @param {Obejct} audioElementProps - Properties of the audio element.
509
+     * @param {number} volume - Properties of the audio element.
510 510
      * @returns {void}
511 511
      */
512
-    _onAudioElementReferenceChanged({ volume }) {
512
+    _onInitialVolumeSet(volume) {
513 513
         if (this.state.volume !== volume) {
514 514
             this.setState({ volume });
515 515
         }

Načítá se…
Zrušit
Uložit