MediaRecorder: stream property
The stream
read-only property of the MediaRecorder
interface returns the stream that was passed into the MediaRecorder()
constructor when the MediaRecorder
was created.
Value
The MediaStream
passed into the MediaRecorder()
constructor when the MediaRecorder
was originally created.
Examples
js
if (navigator.getUserMedia) {
console.log("getUserMedia supported.");
navigator.getUserMedia(
// constraints - only audio needed for this app
{
audio: true,
},
// Success callback
(stream) => {
const mediaRecorder = new MediaRecorder(stream);
const myStream = mediaRecorder.stream;
console.log(myStream);
},
);
}
Specifications
Specification |
---|
MediaStream Recording # dom-mediarecorder-stream |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
stream |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
See also
- Using the MediaStream Recording API
- Web Dictaphone: MediaRecorder + getUserMedia + Web Audio API visualization demo, by Chris Mills (source on GitHub.)
- simpl.info MediaStream Recording demo, by Sam Dutton.
Navigator.getUserMedia