Skip to content

Commit e06d53e

Browse files
authored
Clear Blob Url API (#18)
* Add an api to clear blob Closes #11 * 1.3.0
1 parent ceed484 commit e06d53e

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
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

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-media-recorder",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "A React component based on MediaRecorder() API to record audio/video streams",
55
"main": "index.js",
66
"scripts": {

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)