MediaStream Recording
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.
Syntax
Use the event name in EventTarget/addEventListener:
addEventListener("start", (event) => { })
Alternatively, assign to the event handler property of the interface:
onstart = (event) => { }
Event type
A generic Event.
Example
record.onclick = () => {
mediaRecorder.start();
console.log("recorder started");
};
mediaRecorder.onstart = () => {
// do something in response to
// recording being started
};
Specifications
Browser compatibility
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
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
