Skip to content

Commit 06b2782

Browse files
committed
Add an api to clear blob
Closes #11
1 parent ceed484 commit 06b2782

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ A `function` which unmutes the audio tracks when invoked.
167167

168168
#### mediaBlobUrl
169169

170-
A `blob` url that can be wired to an `<audio />`, `<video />` or an `<a />` element.
170+
A `blob` url that can be wired to an `<audio />`, `<video />` or an `<a />` element.
171+
172+
#### clearBlobUrl
173+
174+
A `function` which clears the existing generated blob url (if any)
171175

172176
#### isMuted
173177

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type ReactMediaRecorderRenderProps = {
1212
status: StatusMessages;
1313
isAudioMuted: boolean;
1414
previewStream: MediaStream | null;
15+
clearBlobUrl: () => void;
1516
};
1617

1718
type ReactMediaRecorderProps = {
@@ -239,5 +240,6 @@ export const ReactMediaRecorder = ({
239240
previewStream: mediaStream.current
240241
? new MediaStream(mediaStream.current.getVideoTracks())
241242
: null,
243+
clearBlobUrl: () => setMediaBlobUrl(null),
242244
});
243245
};

0 commit comments

Comments
 (0)