MediaRecorder: resume event
The resume
event of the MediaRecorder
interface is fired when
MediaRecorder.resume()
is called.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("resume", (event) => {});
onresume = (event) => {};
Event type
A generic Event
.
Example
js
pause.onclick = () => {
if (MediaRecorder.state === "recording") {
mediaRecorder.pause();
// recording paused
} else if (MediaRecorder.state === "paused") {
mediaRecorder.resume();
// resume recording
}
};
mediaRecorder.onpause = () => {
// do something in response to
// recording being paused
};
mediaRecorder.onresume = () => {
// do something in response to
// recording being resumed
};
Specifications
Specification |
---|
MediaStream Recording # dom-mediarecorder-onresume |
Browser compatibility
BCD tables only load in the browser
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