fix camera showing
This commit is contained in:
parent
2b86d44021
commit
cc98d85658
|
@ -37,7 +37,7 @@ const Home = () => {
|
|||
if (videoRef.current) {
|
||||
videoRef.current.srcObject = stream;
|
||||
}
|
||||
setLoadCamera(true);
|
||||
|
||||
|
||||
// setLoadCamera(true);
|
||||
await initializeHandDetection();
|
||||
|
@ -146,6 +146,7 @@ const Home = () => {
|
|||
loadModel();
|
||||
startWebcam();
|
||||
|
||||
setLoadCamera(true);
|
||||
|
||||
|
||||
return () => {
|
||||
|
|
|
@ -51,7 +51,7 @@ const Quiz = () => {
|
|||
videoRef.current.srcObject = stream;
|
||||
}
|
||||
|
||||
setLoadCamera(true);
|
||||
|
||||
|
||||
// setLoadCamera(true);
|
||||
await initializeHandDetection();
|
||||
|
@ -238,6 +238,8 @@ const Quiz = () => {
|
|||
loadModel();
|
||||
startWebcam();
|
||||
|
||||
setLoadCamera(true);
|
||||
|
||||
return () => {
|
||||
if (handLandmarker) {
|
||||
handLandmarker.close();
|
||||
|
|
|
@ -41,8 +41,6 @@ const Quiz = () => {
|
|||
videoRef.current.srcObject = stream;
|
||||
}
|
||||
|
||||
setLoadCamera(true);
|
||||
|
||||
// setLoadCamera(true);
|
||||
await initializeHandDetection();
|
||||
} catch (error) {
|
||||
|
@ -188,6 +186,8 @@ const Quiz = () => {
|
|||
loadModel();
|
||||
startWebcam();
|
||||
|
||||
setLoadCamera(true);
|
||||
|
||||
return () => {
|
||||
if (handLandmarker) {
|
||||
handLandmarker.close();
|
||||
|
|
Loading…
Reference in New Issue