Class: GifRecorder

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

new GifRecorder(mediaStream, config)

GifRecorder is standalone calss used by RecordRTC to record video or canvas into animated gif.
Parameters:
Name Type Description
mediaStream MediaStream MediaStream object or HTMLCanvasElement or CanvasRenderingContext2D.
config object {disableLogs:true, initCallback: function, width: 320, height: 240, frameRate: 200, quality: 10}
Author:
License:
Source:
See:
Example
var recorder = new GifRecorder(mediaStream || canvas || context, { width: 1280, height: 720, frameRate: 200, quality: 10 });
recorder.record();
recorder.stop(function(blob) {
    img.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;
});

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) {
    img.src = URL.createObjectURL(blob);
});

RecordRTC Issues

Help Improve Documentation

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

Latest Updates