mozmorris / react-webcam

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

When user doesn't permit video/camara. Webcam doesn't maintain the aspectRatio #331

Open JosepSalvat opened 2 years ago

JosepSalvat commented 2 years ago

If the user doesn't permit video/audio our webcam shows something like this:

image

I've saw demos that when u don't permit video/audio it still shows the default video layout (black screen).

I'm doing something wrong?

I tried to put only and doesn't work either.

const videoConstraints = { aspectRatio: 0.5625, facingMode: 'user' };

<Webcam className={styles.videoComp} mirrored ref={webcamRef} muted audio videoConstraints={videoConstraints} style={{ width: '100%' }} />