Skip to content

Commit

Permalink
fix: restore destroy mediaStream
Browse files Browse the repository at this point in the history
  • Loading branch information
braden-w committed Jun 30, 2024
1 parent 9001847 commit ae46b89
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/app/src/lib/services/MediaRecorderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ export const MediaRecorderService = Effect.gen(function* () {

const resetRecorder = () => {
recordedChunks.length = 0;
// stream?.getTracks().forEach((track) => track.stop());
// stream = null;
mediaRecorder = null;
mediaStreamService.destroy();
};

return {
Expand Down Expand Up @@ -211,6 +210,10 @@ export const MediaStreamService = Effect.gen(function* () {
internalStream = newStream;
return newStream;
}),
destroy: () => {
internalStream?.getTracks().forEach((track) => track.stop());
internalStream = null;
},
enumerateRecordingDevices,
};
});

0 comments on commit ae46b89

Please sign in to comment.