mozmorris / react-webcam

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

Feeback issue with webcam with sound after updating to 6.x.x version #326

Closed ppprevost closed 2 years ago

ppprevost commented 2 years ago

Hello and thank you for your plugin ! It works very well ! Unfortunatly i don't undersand what you've done on the sixth version ? I have now a big feeback on video when i start a webcam with audio. I just find that in the code you change muted property from audio to !audio ? But i don't understand why ?? Nonetheless adding muted on the webcam resolve the problem.

mozmorris commented 2 years ago

@ppprevost unfortunately there was actually a bug with the audio prop logic.

In v5.x.x the default audio prop was true. Like you say, it was applied to the muted property like so muted={audio}. You can see how this a bug, it made no sense. But fortunately most ppl didn't want audio and so it didn't really cause any issue.

In v6.x.x the default audio proper is now false and it's correctly applied to muted eg muted={!audio}

v5.2.4...v6.0.0#diff-e37d5b7cf8