Sfoglia il codice sorgente

fix(Thumbnail): volume & audioLevel default values

master
Hristo Terezov 4 anni fa
parent
commit
db48dc3ed3

+ 4
- 1
react/features/audio-level-indicator/components/AudioLevelIndicator.js Vedi File

39
      * @returns {ReactElement}
39
      * @returns {ReactElement}
40
      */
40
      */
41
     render() {
41
     render() {
42
+        const { audioLevel: passedAudioLevel } = this.props;
43
+
42
         // First make sure we are sensitive enough.
44
         // First make sure we are sensitive enough.
43
-        const audioLevel = Math.min(this.props.audioLevel * 1.2, 1);
45
+        const audioLevel = typeof passedAudioLevel === 'number' && !isNaN(passedAudioLevel)
46
+            ? Math.min(passedAudioLevel * 1.2, 1) : 0;
44
 
47
 
45
         // Let's now stretch the audio level over the number of dots we have.
48
         // Let's now stretch the audio level over the number of dots we have.
46
         const stretchedAudioLevel = AUDIO_LEVEL_DOTS * audioLevel;
49
         const stretchedAudioLevel = AUDIO_LEVEL_DOTS * audioLevel;

+ 2
- 2
react/features/filmstrip/components/web/Thumbnail.js Vedi File

401
             _videoTrack
401
             _videoTrack
402
         } = this.props;
402
         } = this.props;
403
         const { id } = _participant || {};
403
         const { id } = _participant || {};
404
-        const { audioLevel = 0 } = this.state;
404
+        const { audioLevel } = this.state;
405
 
405
 
406
 
406
 
407
         return (
407
         return (
447
             _startSilent
447
             _startSilent
448
         } = this.props;
448
         } = this.props;
449
         const { id } = _participant;
449
         const { id } = _participant;
450
-        const { audioLevel = 0, volume = 1 } = this.state;
450
+        const { audioLevel, volume } = this.state;
451
 
451
 
452
         // hide volume when in silent mode
452
         // hide volume when in silent mode
453
         const onVolumeChange = _startSilent ? undefined : this._onVolumeChange;
453
         const onVolumeChange = _startSilent ? undefined : this._onVolumeChange;

+ 2
- 2
react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js Vedi File

75
      * A value between 0 and 1 indicating the volume of the participant's
75
      * A value between 0 and 1 indicating the volume of the participant's
76
      * audio element.
76
      * audio element.
77
      */
77
      */
78
-    initialVolumeValue: number,
78
+    initialVolumeValue: ?number,
79
 
79
 
80
     /**
80
     /**
81
      * Callback to invoke when changing the level of the participant's
81
      * Callback to invoke when changing the level of the participant's
210
                 participantID = { participantID } />
210
                 participantID = { participantID } />
211
         );
211
         );
212
 
212
 
213
-        if (onVolumeChange) {
213
+        if (onVolumeChange && initialVolumeValue && !isNaN(initialVolumeValue)) {
214
             buttons.push(
214
             buttons.push(
215
                 <VolumeSlider
215
                 <VolumeSlider
216
                     initialValue = { initialVolumeValue }
216
                     initialValue = { initialVolumeValue }

Loading…
Annulla
Salva