ref(device-selection): update preview tracks on component update
This commit is contained in:
parent
14adc0b887
commit
77f8f85b96
|
@ -151,7 +151,8 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if audio / video permissions were granted.
|
* Checks if audio / video permissions were granted. Updates audio input and
|
||||||
|
* video input previews.
|
||||||
*
|
*
|
||||||
* @param {Object} prevProps - Previous props this component received.
|
* @param {Object} prevProps - Previous props this component received.
|
||||||
* @param {Object} prevState - Previous state this component had.
|
* @param {Object} prevState - Previous state this component had.
|
||||||
|
@ -174,25 +175,15 @@ class DeviceSelection extends AbstractDialogTab<Props, State> {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if (prevProps.selectedAudioInputId
|
||||||
* Updates audio input and video input previews.
|
!== this.props.selectedAudioInputId) {
|
||||||
*
|
this._createAudioInputTrack(this.props.selectedAudioInputId);
|
||||||
* @inheritdoc
|
|
||||||
* @param {Object} nextProps - The read-only props which this Component will
|
|
||||||
* receive.
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
componentWillReceiveProps(nextProps: Object) {
|
|
||||||
const { selectedAudioInputId, selectedVideoInputId } = this.props;
|
|
||||||
|
|
||||||
if (selectedAudioInputId !== nextProps.selectedAudioInputId) {
|
|
||||||
this._createAudioInputTrack(nextProps.selectedAudioInputId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedVideoInputId !== nextProps.selectedVideoInputId) {
|
if (prevProps.selectedVideoInputId
|
||||||
this._createVideoInputTrack(nextProps.selectedVideoInputId);
|
!== this.props.selectedVideoInputId) {
|
||||||
|
this._createVideoInputTrack(this.props.selectedVideoInputId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue