WebAssemblyRecorder(mediaStream, config)

new WebAssemblyRecorder(mediaStream, config)

Video recording feature in Chrome, Firefox and maybe Edge.

WebAssemblyRecorder lets you create webm videos in JavaScript via WebAssembly. The library consumes raw RGBA32 buffers (4 bytes per pixel) and turns them into a webm video with the given framerate and quality. This makes it compatible out-of-the-box with ImageData from a CANVAS. With realtime mode you can also use webm-wasm for streaming webm videos.

Parameters:
Name Type Description
mediaStream MediaStream

MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.

config object

{webAssemblyPath:'webm-wasm.wasm',workerPath: 'webm-worker.js', frameRate: 30, width: 1920, height: 1080, bitrate: 1024}

Author:
License:
Source:
See:
Example
var recorder = new WebAssemblyRecorder(mediaStream);
recorder.record();
recorder.stop(function(blob) {
    video.src = URL.createObjectURL(blob);
});

Members

(static) this.blob

Properties:
Name Type Description
blob Blob

The recorded blob object.

Source:
Example
recorder.stop(function(){
    var blob = recorder.blob;
});

(static) this.blob

Properties:
Name Type Description
blob Blob

The recorded blob object.

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.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.pause()

This method pauses the recording process.

Source:
Example
recorder.pause();

(static) this.record()

This method records video.

Source:
Example
recorder.record();

(static) this.record()

This method records video.

Source:
Example
recorder.record();

(static) this.resume()

This method resumes the recording process.

Source:
Example
recorder.resume();

(static) this.resume()

This method resumes the recording process.

Source:
Example
recorder.resume();

(static) this.stop(callback)

This method stops recording video.

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);
});

(static) this.stop(callback)

This method stops recording video.

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);
});

WebAssemblyRecorder(mediaStream, config)

new WebAssemblyRecorder(mediaStream, config)

Video recording feature in Chrome, Firefox and maybe Edge.

WebAssemblyRecorder lets you create webm videos in JavaScript via WebAssembly. The library consumes raw RGBA32 buffers (4 bytes per pixel) and turns them into a webm video with the given framerate and quality. This makes it compatible out-of-the-box with ImageData from a CANVAS. With realtime mode you can also use webm-wasm for streaming webm videos.

Parameters:
Name Type Description
mediaStream MediaStream

MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.

config object

{webAssemblyPath:'webm-wasm.wasm',workerPath: 'webm-worker.js', frameRate: 30, width: 1920, height: 1080, bitrate: 1024}

Author:
License:
Source:
See:
Example
var recorder = new WebAssemblyRecorder(mediaStream);
recorder.record();
recorder.stop(function(blob) {
    video.src = URL.createObjectURL(blob);
});

Members

(static) this.blob

Properties:
Name Type Description
blob Blob

The recorded blob object.

Source:
Example
recorder.stop(function(){
    var blob = recorder.blob;
});

(static) this.blob

Properties:
Name Type Description
blob Blob

The recorded blob object.

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.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.pause()

This method pauses the recording process.

Source:
Example
recorder.pause();

(static) this.record()

This method records video.

Source:
Example
recorder.record();

(static) this.record()

This method records video.

Source:
Example
recorder.record();

(static) this.resume()

This method resumes the recording process.

Source:
Example
recorder.resume();

(static) this.resume()

This method resumes the recording process.

Source:
Example
recorder.resume();

(static) this.stop(callback)

This method stops recording video.

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);
});

(static) this.stop(callback)

This method stops recording video.

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);
});