Skip to content

Commit

Permalink
Update Modal.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-NaN authored Feb 11, 2023
1 parent 20a6f33 commit 6dfea4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class CameraModal extends Modal {
switchCameraButton.onclick = async () => {
cameraIndex = (cameraIndex + 1) % cameras.length;
this.videoStream = null;
this.videoStream = yield navigator.mediaDevices.getUserMedia({video: { deviceId: cameras[cameraIndex].deviceId }, audio: true});
this.videoStream = await navigator.mediaDevices.getUserMedia({video: { deviceId: cameras[cameraIndex].deviceId }, audio: true});
videoEl.srcObject = this.videoStream;
videoEl.play();
};
Expand Down

0 comments on commit 6dfea4d

Please sign in to comment.