From dd1d1b6844bb82d3201e671288a9d0fe9933edd0 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 9 Nov 2023 17:22:17 +0100 Subject: [PATCH] www: make sure screen media stream is closed after we press stop --- www/app/[domain]/transcripts/recorder.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/app/[domain]/transcripts/recorder.tsx b/www/app/[domain]/transcripts/recorder.tsx index 435ea7b4..4b2e8eb0 100644 --- a/www/app/[domain]/transcripts/recorder.tsx +++ b/www/app/[domain]/transcripts/recorder.tsx @@ -232,8 +232,12 @@ export default function Recorder(props: RecorderProps) { if (record.isRecording()) { if (props.onStop) props.onStop(); record.stopRecording(); + if (screenMediaStream) { + screenMediaStream.getTracks().forEach((t) => t.stop()); + } setIsRecording(false); setHasRecorded(true); + setScreenMediaStream(null); setDestinationStream(null); } else { const stream = await getCurrentStream();