How to make fullscreen mobile camera view like expo-camera but with react-webcam?
Using Expo-Camera/Tailwind, the below code would create a fullscreen camera view on mobile.
// Creates the camera itself, on web, it'd use getUserMedia/Stream API, see https://docs.expo.dev/versions/latest/sdk/camera/#web-support
<Camera type={CameraType.back}>
// Container for the camera, set to be screen height
<div className='flex-1 bg-transparent min-h-screen'></div>
</Camera>
Looking at their camera settings, I've done exactly the same but with react-webcam, which should be fullscreen camera view on mobile.
const videoConstraints = {
facingMode: { exact: "environment" },
autoFocus: 'continuous',
flashMode: 'off',
whiteBalance: 'continuous',
zoom: 0,
focusDepth: 0,
ratio: '4:3',
};
<div className='flex-1 bg-transparent min-h-screen'>
<Webcam className="flex-1 bg-transparent" videoConstraints={videoConstraints} />
</div>
However, it's not a full screen camera view, it's like 3/4 filled.