Web/API/MediaRecorder/onstart

From Get docs


The MediaRecorder.onstartevent handler (part of the MediaRecorder API) handles the start event, allowing you to run code in response to media recording being started by a MediaRecorder.

The start event is thrown as a result of the MediaRecorder.start() method being invoked. At this point, the data starts being gathered into a Blob.

Syntax

MediaRecorder.onstart = function(event) { ... }
MediaRecorder.addEventListener('start', function(event) { ... })

Example

...

  record.onclick = function() {
    mediaRecorder.start();
    console.log("recorder started");
  }

  mediaRecorder.onstart = function() {
    // do something in response to
    // recording being started
  }

...

Properties

None.

Specifications

Specification Status Comment
MediaStream RecordingThe definition of 'MediaRecorder.onstart' in that specification. Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
onstart Chrome

Full support 49

Edge

Full support 79

Firefox

Full support 25

IE

No support No

Opera

Full support 36

Safari

No support No

WebView Android

Full support 49

Chrome Android

Full support 49

Firefox Android

Full support 25

Opera Android

Full support 36

Safari iOS

No support No

Samsung Internet Android

Full support 5.0

Legend

Full support  
Full support
No support  
No support


See also