Class: RecordRTCPromisesHandler

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

new RecordRTCPromisesHandler(mediaStream, config)

Promises for RecordRTC

RecordRTCPromisesHandler adds promises support in RecordRTC. Try a demo here
Parameters:
Name Type Description
mediaStream MediaStream Single media-stream object, array of media-streams, html-canvas-element, etc.
config object {type:"video", recorderType: MediaStreamRecorder, disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, etc.}
Author:
License:
Source:
See:
Requires:
  • module:RecordRTC
Throws:
Will throw an error if "new" keyword is not used to initiate "RecordRTCPromisesHandler". Also throws error if first argument "MediaStream" is missing.
Example
var recorder = new RecordRTCPromisesHandler(mediaStream, options);
recorder.startRecording()
        .then(successCB)
        .catch(errorCB);

Requires

  • module:RecordRTC

Members

(static) self.recordRTC

Properties:
Name Type Description
blob Blob Access/reach the native RecordRTC object.
Source:
Example
var internal = recorder.recordRTC.getInternalRecorder();
alert(internal instanceof MediaStreamRecorder);

(static) this.blob

Properties:
Name Type Description
blob Blob Recorded data as "Blob" object.
Source:
Example
recorder.stopRecording().then(function() {
    var blob = recorder.getBlob();
}).catch(errorCB);

Methods

(static) this.getBlob()

This method returns the recorded blob.
Source:
Example
recorder.stopRecording().then(function() {
    var blob = recorder.getBlob();
}).catch(errorCB);

(static) this.getDataURL()

This method returns data-url for the recorded blob.
Source:
Example
recorder.stopRecording().then(function() {
    recorder.getDataURL().then(function(dataURL) {
        window.open(dataURL);
    }).catch(errorCB);;
}).catch(errorCB);

(static) this.startRecording()

This method records MediaStream.
Source:
Example
recorder.startRecording()
        .then(successCB)
        .catch(errorCB);

(static) this.stopRecording()

This method stops the recording.
Source:
Example
recorder.stopRecording().then(function() {
    var blob = recorder.getBlob();
}).catch(errorCB);