mozmorris / react-webcam

Webcam component
https://codepen.io/mozmorris/pen/JLZdoP
MIT License
1.66k stars 281 forks source link

When audio is false there is not audio in the MediaStream from the Webcam #395

Open markVaykhansky opened 9 months ago

markVaykhansky commented 9 months ago

Please follow the general troubleshooting steps first:

Bug reports:

Not sure if this is intended or not.

Use case: We want a webcam with an audio stream to record but it shouldn't playback the audio.

When I set audio prop to false in order to mute the Webcam it also disables the audio stream of the WebCam's MediaStream. There should not be coupling between the two.

I belive that removing the if statement on line 278 in react-webcam.tsx should do the trick.

mozmorris commented 8 months ago

<Webcam muted={true} audio /> should do the trick.