MediaRecorder: pause event
The pause
event is thrown as a result of the
MediaRecorder.pause()
method being invoked.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
addEventListener('pause', event => { });
onpause = event => { };
Event type
A generic Event
.
Example
...
pause.onclick = function() {
if(mediaRecorder.state === "recording") {
mediaRecorder.pause();
// recording paused
} else if(mediaRecorder.state === "paused") {
mediaRecorder.resume();
// resume recording
}
}
mediaRecorder.onpause = function() {
// do something in response to
// recording being paused
}
mediaRecorder.onresume = function() {
// do something in response to
// recording being resumed
}
...
Properties
None.
Specifications
No specification found
No specification data found for api.MediaRecorder.pause_event
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
No compatibility data found for api.MediaRecorder.pause_event
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.
See also
- Using the MediaRecorder 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