MediaRecorder: start event

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.

The start event of the MediaRecorder interface is fired when MediaRecorder.start() is called. At this point, the data starts being gathered into a Blob.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("start", (event) => {});

onstart = (event) => {};

Event type

A generic Event.

Example

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

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

Specifications

Specification
MediaStream Recording
# dom-mediarecorder-onstart

Browser compatibility

See also