Parcourir la source

ref(device-selection): update preview tracks on component update

master
Leonard Kim il y a 7 ans
Parent
révision
77f8f85b96
1 fichiers modifiés avec 8 ajouts et 17 suppressions
  1. 8
    17
      react/features/device-selection/components/DeviceSelection.js

+ 8
- 17
react/features/device-selection/components/DeviceSelection.js Voir le fichier

@@ -151,7 +151,8 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
151 151
     }
152 152
 
153 153
     /**
154
-     * Checks if audio / video permissions were granted.
154
+     * Checks if audio / video permissions were granted. Updates audio input and
155
+     * video input previews.
155 156
      *
156 157
      * @param {Object} prevProps - Previous props this component received.
157 158
      * @param {Object} prevState - Previous state this component had.
@@ -174,25 +175,15 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
174 175
                 });
175 176
             });
176 177
         }
177
-    }
178
-
179
-    /**
180
-     * Updates audio input and video input previews.
181
-     *
182
-     * @inheritdoc
183
-     * @param {Object} nextProps - The read-only props which this Component will
184
-     * receive.
185
-     * @returns {void}
186
-     */
187
-    componentWillReceiveProps(nextProps: Object) {
188
-        const { selectedAudioInputId, selectedVideoInputId } = this.props;
189 178
 
190
-        if (selectedAudioInputId !== nextProps.selectedAudioInputId) {
191
-            this._createAudioInputTrack(nextProps.selectedAudioInputId);
179
+        if (prevProps.selectedAudioInputId
180
+            !== this.props.selectedAudioInputId) {
181
+            this._createAudioInputTrack(this.props.selectedAudioInputId);
192 182
         }
193 183
 
194
-        if (selectedVideoInputId !== nextProps.selectedVideoInputId) {
195
-            this._createVideoInputTrack(nextProps.selectedVideoInputId);
184
+        if (prevProps.selectedVideoInputId
185
+            !== this.props.selectedVideoInputId) {
186
+            this._createVideoInputTrack(this.props.selectedVideoInputId);
196 187
         }
197 188
     }
198 189
 

Chargement…
Annuler
Enregistrer