GifRecorder(mediaStream, config)

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, { onGifPreview: function, onGifRecordingStarted: function, 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;
});

(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 MediaStream.

Source:
Example
recorder.record();

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

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

GifRecorder(mediaStream, config)

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, { onGifPreview: function, onGifRecordingStarted: function, 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;
});

(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 MediaStream.

Source:
Example
recorder.record();

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

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