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 Status Comment
MediaStream Recording
The definition of 'MediaRecorder.onresume' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 47
Disabled
Full support 47
Disabled
Disabled From version 47: this feature is behind the Experimental Web Platform features preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
Edge ? Firefox Full support 25IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 25Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
User must explicitly enable this feature.
User must explicitly enable this feature.

See also

Document Tags and Contributors

Contributors to this page: lucian95, jpmedley, Sebastianz, chrisdavidmills, teoli, kscarfone
Last updated by: lucian95,