The pause
event is thrown as a result of the MediaRecorder.pause()
method being invoked.
The pause
event is thrown as a result of the MediaRecorder.pause()
method being invoked.
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("pause", (event) => {}); onpause = (event) => {};
A generic Event
.
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 };
None.
Specification |
---|
MediaStream Recording # dom-mediarecorder-onpause |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
pause_event |
49 | 79 | 65 | No | 36 | 14.1 | 49 | 49 | 65 | 36 | 14.5 | 5.0 |
Navigator.getUserMedia
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/pause_event