react-webcam
react-webcam copied to clipboard
Webcam showing blank screen in samsung mobiles (s22,23,24) devices
Hi, Webcam showing blank screen in real samsung mobiles (s22,23,24) devices, when try to replicate this in emulators working fine Can you please suggest me for any idea on this.
// Not specify any width and height. they fit into the screen. const videoConstraints = [ facingMode: "environment",]
const capture = React.useCallback(() => { const imageSrc = videoElement.current.getScreenshot(); return imageSrc; }, [videoElement]);
<Webcam audio={false} ref={videoElement} videoConstraints={videoConstraints} screenshotFormat="image/png" imageSmoothing="true" screenshotQuality="1" />
Issue:
in my case, it was because of the video constraints
const videoConstraints = {
height: { ideal: 1920, max: 4096 },
width: { ideal: 1920, max: 4096 },
facingMode: { ideal: "environment" },
aspectRatio: { ideal: 1 },
}
use ideal solved blank camera