From 0fc5ccd7bdbec2e37a2b10af7457e21c042a00fc Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 15 Aug 2024 17:27:09 +0200 Subject: [PATCH] - Switch camera --- src/App.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 64ea383..e2fd3c2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,6 +11,10 @@ function App() { setView(view === 'camera' ? '3d' : 'camera'); } + const onSwitch = () => { + webcamRef.current.switchCamera(); + } + const webcamRef = useRef(null); const cameraCanvasRef = useRef(null); const overlayCanvasRef = useRef(null); @@ -62,7 +66,8 @@ function App() { switchCamera: "switchCamera", canvas: "canvas", }}/> - + {