start method

void start([
  1. int timeslice
])

The start() method of the MediaRecorder interface begins recording media into one or more Blob objects.

You can record the entire duration of the media into a single Blob (or until you call MediaRecorder.requestData), or you can specify the number of milliseconds to record at a time. Then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new Blob is created to record the next slice of the media.

Assuming the MediaRecorder's MediaRecorder.state is inactive, start() sets the state to recording, then begins capturing media from the input stream. A Blob is created and the data is collected in it until the time slice period elapses or the source media ends. Each time a Blob is filled up to that point (the timeslice duration or the end-of-media, if no slice duration was provided), a MediaRecorder.dataavailable_event event is sent to the MediaRecorder with the recorded data. If the source is still playing, a new Blob is created and recording continues into that, and so forth.

When the source stream ends, state is set to inactive and data gathering stops. A final MediaRecorder.dataavailable_event event is sent to the MediaRecorder, followed by a MediaRecorder/stop_event event.

Note: If the browser is unable to start recording or continue recording, it will raise an MediaRecorder.error_event event, followed by a MediaRecorder.dataavailable_event event containing the Blob it has gathered, followed by the MediaRecorder/stop_event event.

Implementation

external void start([int timeslice]);