diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index b4ee708..970ef8d 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -51,18 +51,19 @@ const Home = () => { const startWebcam = async () => { try { + console.log("Requesting camera access..."); const stream = await navigator.mediaDevices.getUserMedia({ video: true, }); - setLoadCamera(true); - if (videoRef.current) { videoRef.current.srcObject = stream; mediapipeHelper = new MediapipeHelper(videoRef); detectionHelper = new DetectionHelper(); + console.log("Camera access granted and helpers initialized."); } + setLoadCamera(true); onHandDetected(); } catch (error) { console.error("Error accessing webcam:", error); diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..3a48e56 --- /dev/null +++ b/vercel.json @@ -0,0 +1,3 @@ +{ + "rewrites": [{ "source": "/(.*)", "destination": "/" }] +}