diff --git a/src/hooks/useCaptureProvider.ts b/src/hooks/useCaptureProvider.ts index 0345588b..a1815e66 100644 --- a/src/hooks/useCaptureProvider.ts +++ b/src/hooks/useCaptureProvider.ts @@ -18,6 +18,10 @@ export function useCaptureProvider(wsRef: React.RefObject) { for (const track of streamRef.current.getTracks()) track.stop() streamRef.current = null } + if (videoRef.current) { + videoRef.current.pause() + videoRef.current.srcObject = null + } if (wsRef.current && wsRef.current.readyState === WebSocket.OPEN) { wsRef.current.send(JSON.stringify({ type: "stop-mirror" })) }