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