muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.

Home Page:https://www.webrtc-experiment.com/RecordRTC/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support for angular2

amarewgs opened this issue · comments

does this support angular2?

Hi @amarewgs ,
I know this is kinda pretty late. But I was searching for the same and have created a working repo for this.
https://github.com/ShankarSumanth/Angular2-RecordRTC

Also Here is an article for the same. Integrate RecordRTC With Angular 2

How I will send the the file to server. I am using below code to send the recorded file but not working.
FormData is showing null after appending in Angular 2.

public uploadToServer() {
let blob = this.recordRTC instanceof Blob ? this.recordRTC : this.recordRTC.blob;
let fileType = blob.type.split('/')[0] || 'audio';
let fileName = (Math.random() * 1000).toString().replace('.', '');
if (fileType === 'audio') {
fileName += '.' + (!!navigator.mozGetUserMedia ? 'ogg' : 'wav');
} else {
fileName += '.webm';
}
// create FormData
var formData: FormData = new FormData();
formData.append(fileType + '-filename', fileName);
formData.append(fileType + '-blob', blob);
this.dashboard.saveRecording(formData).subscribe(
data => this.saveRecordingSuccess(data),
error => this.saveRecordingFail(error)
);
}

Hii @ShankarSumanth does recordRTC works on angular4 i have some issue on importing recordRTC in ts file using angular 4. Pls help me .