react-webcam icon indicating copy to clipboard operation
react-webcam copied to clipboard

Webcam showing blank screen in samsung mobiles (s22,23,24) devices

Open missionlop opened this issue 11 months ago • 1 comments

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:

Image

missionlop avatar Feb 12 '25 09:02 missionlop

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

rifansyah avatar Oct 14 '25 03:10 rifansyah