release microphone after pressing stop
This commit is contained in:
parent
97ec6f706f
commit
519c9d6fad
1 changed files with 6 additions and 0 deletions
|
@ -82,6 +82,12 @@ function App() {
|
|||
|
||||
const stopRecording = () => {
|
||||
mediaRecorderRef.current.stop();
|
||||
|
||||
// Stop all tracks on the media stream
|
||||
if (mediaRecorderRef.current.stream) {
|
||||
mediaRecorderRef.current.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
|
||||
setIsRecording(false);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue