Closed JeanPaul1789 closed 10 months ago
witt MaterialUI components
........
const [isCameraLoading, setIsCameraLoading] = useState(true);
const handleCameraLoaded = () => {
setIsCameraLoading(false);
};
return(
.......
{isCameraLoading && (
<Typography
color={(theme) => theme.palette.neutral[700]}
variant="subtitle2"
sx={{
fontWeight: 700,
textAlign: "center",
}}
>
Loading Camera...
</Typography>
)}
<Webcam
audio={false}
ref={webcamRef}
screenshotFormat="image/jpeg"
screenshotQuality={1}
width={240}
height="auto"
onUserMedia={handleCameraLoaded}
/>
)
Hello, i'm trying to do a photobooth app, i'm using it on a tablet that is not very efficient, so the camera is loading during 3/4 seconds before showing the video feed.
I was wondering if there was a way to display a placeholder while the camera is loading. I tried to use a simple title but with the css attribute z-index to show. Here is the code i use:
The return of my page
css:
This method don't work, but because I'm a beginner in html/css you could see what's wrong.
So do you know any other method to display a placeholder when the camera is loading ?
Thank you