Class: MediaStreamRecorder

© Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?

new MediaStreamRecorder(mediaStream, config)

Runs top over MediaRecorder API.

MediaStreamRecorder is an abstraction layer for "MediaRecorder API". It is used by RecordRTC to record MediaStream(s) in Firefox.
Parameters:
Name Type Description
mediaStream MediaStream MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
config object {disableLogs:true, initCallback: function, mimeType: "video/webm", onAudioProcessStarted: function}
Author:
License:
Source:
See:
Example
var options = {
    mimeType: 'video/webm',
    audioBitsPerSecond : 256 * 8 * 1024,
    videoBitsPerSecond : 256 * 8 * 1024,
    bitsPerSecond: 256 * 8 * 1024,  // if this is provided, skip above two
    getNativeBlob: true // by default: it is false
}
var recorder = new MediaStreamRecorder(MediaStream, options);
recorder.record();
recorder.stop(function(blob) {
    video.src = URL.createObjectURL(blob);

    // or
    var blob = recorder.blob;
});

Members

(static) self.blob

Properties:
Name Type Description
blob Blob Recorded frames in video/webm blob.
Source:
Example
recorder.stop(function() {
    var blob = recorder.blob;
});

Methods

(static) this.clearRecordedData()

This method resets currently recorded data.
Source:
Example
recorder.clearRecordedData();

(static) this.pause()

This method pauses the recording process.
Source:
Example
recorder.pause();

(static) this.record()

This method records MediaStream.
Source:
Example
recorder.record();

(static) this.resume()

This method resumes the recording process.
Source:
Example
recorder.resume();

(static) this.stop(callback)

This method stops recording MediaStream.
Parameters:
Name Type Description
callback function Callback function, that is used to pass recorded blob back to the callee.
Source:
Example
recorder.stop(function(blob) {
    video.src = URL.createObjectURL(blob);
});

RecordRTC Issues

Help Improve Documentation

Enter your email too; if you want "direct" reply!

Latest Updates