Basically, I was trying to get a webcam screenshot with react. But the condition is it will get the screenshot only after giving access to it and after each 10 seconds interval.
The problem is the webcam screen must be there to take a screenshot. But I don't want the webcam screen to be there but when I press a button it should take the screenshot.
I was using this library React webcam
I tried with visibility hidden to the div and also zIndex to be big negative value with absolute position but its not taking the screenshot without that webcam div.
This is the component I'm using from that library. Tried to remove height and width also but without that webcam screen to be top of the screen it is not taking the image. Showing only blank white image.
<Webcam
audio={false}
height={200}
ref={webcamRef}
screenshotFormat={screenshotFormat}
width={200}
videoConstraints={videoConstraints}
onUserMedia={handleWebCamEnabled}
onUserMediaError={handleWebCamError}
/>