MediaStream recording
The BlobEvent interface of the MediaStream Recording API represents events associated with a Blob. These blobs are typically, but not necessarily, associated with media content.
Event BlobEvent
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 49 | 79 | 21 | 14 | 49 | 14 | |
| The BlobEvent() constructor returns a newly created BlobEvent object with an associated Blob. | 49 | 79 | 21 | 14 | 49 | 14 |
| The data read-only property of the BlobEvent interface represents a Blob associated with the event. | 49 | 79 | 21 | 14 | 49 | 14 |
| The timecode read-only property of the BlobEvent interface indicates the difference between the timestamp of the first chunk of data, and the timestamp of the first chunk in the first BlobEvent produced by this recorder. | 57 | 79 | | 14.1 | 57 | 14.5 |
| The MediaRecorder interface of the MediaStream Recording API provides functionality to easily record media. It is created using the MediaRecorder.MediaRecorder constructor. | 47 | 79 | 25 | 14.1 | 47 | 14 |
audioBitrateMode Experimental The audioBitrateMode read-only property of the MediaRecorder interface returns the bitrate mode used to encode audio tracks. | 89 | 89 | | | 89 | |
| The audioBitsPerSecond read-only property of the MediaRecorder interface returns the audio encoding bit rate in use. | 49 | 79 | 71 | 14.1 | 49 | 14.5 |
| The dataavailable event of the MediaRecorder interface is fired when the MediaRecorder delivers media data to your application for its use. The data is provided in a Blob object that contains the data. This occurs in four situations: | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The error event of the MediaRecorder interface is fired when an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The isTypeSupported() static method of the MediaRecorder interface returns a Boolean which is true if the MIME media type specified is one the user agent should be able to successfully record. | 47 | 79 | 25 | 14.1 | 47 | 14 |
| The MediaRecorder() constructor creates a new MediaRecorder object that will record a specified MediaStream. | 47 | 79 | 25 | 14.1 | 47 | 14 |
MediaRecorder (options parameter) `options` parameter | 49 | 79 | 43 | 14.1 | 49 | 14 |
| The mimeType read-only property of the MediaRecorder interface returns the MIME media type that was specified when creating the MediaRecorder object, or, if none was specified, which was chosen by the browser. This is the file format of the file that would result from writing all of the recorded data to disk. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The pause() method of the MediaRecorder interface is used to pause recording of media streams. | 49 | 79 | 25 | 14.1 | 49 | 14.5 |
| The pause event of the MediaRecorder interface is fired when MediaRecorder.pause() is called. | 49 | 79 | 65 | 14.1 | 49 | 14.5 |
| The requestData() method of the MediaRecorder interface is used to raise a MediaRecorder.dataavailable_event event containing a Blob object of the captured media as it was when the method was called. This can then be grabbed and manipulated as you wish. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The resume() method of the MediaRecorder interface is used to resume media recording when it has been previously paused. | 49 | 79 | 25 | 14.1 | 49 | 14.5 |
| The resume event of the MediaRecorder interface is fired when MediaRecorder.resume() is called. | 49 | 79 | 65 | 14.1 | 49 | 14.5 |
| The start() method of the MediaRecorder interface begins recording media into one or more Blob objects. | 47 | 79 | 25 | 14.1 | 47 | 14 |
| The start event of the MediaRecorder interface is fired when MediaRecorder.start() is called. At this point, the data starts being gathered into a Blob. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The state read-only property of the MediaRecorder interface returns the current state of the current MediaRecorder object. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The stop() method of the MediaRecorder interface is used to stop media capture. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The stop event of the MediaRecorder interface is fired when MediaRecorder.stop() is called, or when the media stream being captured ends. In each case, the stop event is preceded by a dataavailable event, making the Blob captured up to that point available for you to use in your application. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The stream read-only property of the MediaRecorder interface returns the stream that was passed into the MediaRecorder.MediaRecorder constructor when the MediaRecorder was created. | 49 | 79 | 25 | 14.1 | 49 | 14 |
| The videoBitsPerSecond read-only property of the MediaRecorder interface returns the video encoding bit rate in use. | 49 | 79 | 71 | 14.1 | 49 | 14.5 |
- Before Firefox 58, using `MediaStream.addTrack()` on a stream obtained using `getUserMedia()`, then attempting to record the resulting stream would result in only recording the original stream without the added tracks (severe bug).
- This browser only partially implements this feature
- The interface for this event is a plain `Event`, not `ErrorEvent`. See bug 40791876.
- This browser only partially implements this feature
- The interface for this event is a plain `Event`, not `ErrorEvent`. See bug 40791876.
- This browser only partially implements this feature
- The interface for this event is a plain `Event`, not `ErrorEvent`. See bug 40791876.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome 49, only video is supported, not audio.
- Starting with Firefox 71, the behavior of `mimeType` is more consistent. For example, it now returns the media type even after recording has stopped.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome Android 49, only video is supported, not audio.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome 49, only video is supported, not audio.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome Android 49, only video is supported, not audio.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome 49, only video is supported, not audio.
- This browser only partially implements this feature
- This feature was removed in a later browser version (49)
- Before Chrome Android 49, only video is supported, not audio.
Use cases
-
Using MediaStream recording
The BlobEvent interface of the MediaStream Recording API represents events associated with a Blob.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.