Skip to content
Snippets Groups Projects
Unverified Commit 7daa4dd2 authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #6622 from MaximKhlobystov/webcam-device-id

Fix the issue with webcam preview and webcams dropdown
parents 6c06abc5 6c576775
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,6 @@ class VideoPreview extends Component {
componentDidMount() {
const { webcamDeviceId, changeWebcam } = this.props;
const { webcamDeviceId: savedWebcamDeviceId } = this.state;
const constraints = {
video: VIDEO_CONSTRAINTS,
};
......@@ -174,7 +173,7 @@ class VideoPreview extends Component {
this.setState({ availableWebcams: webcams });
}
constraints.video.deviceId = { exact: savedWebcamDeviceId };
constraints.video.deviceId = { exact: this.state.webcamDeviceId };
navigator.mediaDevices.getUserMedia(constraints).then((stream) => {
// display the preview
this.video.srcObject = stream;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment