Вы читаете английскую версию этой статьи, так как пока нет перевода на данный язык. Помогите нам перевести эту статью!

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.


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



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

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





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

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onstartChrome Full support 49Edge No support NoFirefox Full support 25IE ? Opera Full support 36Safari ? WebView Android Full support 49Chrome Android Full support 49Firefox Android Full support 25Opera Android Full support 36Safari iOS ? Samsung Internet Android Full support Yes


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also