MediaRecorder.onresume
The MediaRecorder.onresume
event handler (part of the MediaRecorder API) handles the resume
event, allowing you to run code in response to the media recording being resumed after pausing.
The resume
event is thrown as a result of the MediaRecorder.resume()
method being invoked.
Syntax
MediaRecorder.onresume = function(event) { ... } MediaRecorder.addEventListener('resume', function(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
Specification |
---|
MediaStream Recording # dom-mediarecorder-onresume |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
onresume |
49 |
79 |
65 |
No |
36 |
14.1 |
49 |
49 |
65 |
36 |
14.5 |
5.0 |
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
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/onresume