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.
I'm using recoredRTC in Angular framework .. so when I tried to use the getSeekableBlob() and invokeSaveAsDialog() function on my code the following error pops up.
ERROR in src/app/components/record-rtc/record-rtc.component.ts(120,7): error TS2304:
Cannot find name 'getSeekableBlob'.
src/app/components/record-rtc/record-rtc.component.ts(122,10): error TS2304: Cannot
find name 'invokeSaveAsDialog'.
Note that I have installed recordRTC using npm on my project and then I imported it as follows
import * as RecordRTC from 'recordrtc';
export class RecordRtcComponent implements AfterViewInit {
private stream: MediaStream;
private recordRTC: any;
@ViewChild('video', { static: false }) video: any
processVideo(audioVideoWebMURL) {
let timestamp = (new Date()).valueOf();
this.dt = this.datePipe.transform(timestamp, 'dd-MMM-yyyy_hh-mm-ss');
//Filename of the video
this.fileName = 'Video_' + this.dt + '.mp4';
let video: HTMLVideoElement = this.video.nativeElement;
let recordRTC = this.recordRTC;
video.src = audioVideoWebMURL;
this.toggleControls();
this.recordedBlob = recordRTC.getBlob();
recordRTC.getDataURL(function (dataURL) { });
console.log(recordRTC);
//To show video duration
getSeekableBlob(recordRTC.getBlob(), function(seekableBlob) {
video.src = URL.createObjectURL(seekableBlob);
invokeSaveAsDialog(seekableBlob, 'seekable-recordrtc.webm');
});
}
stopRecording() {
// We use the mediaStream to relase the web cam and microphone
let recordRTC = this.recordRTC;
// Obtain the recorded video URL and provide it as an argument to "processVideo()"
recordRTC.stopRecording(this.processVideo.bind(this));
let stream = this.stream;
I'm using recoredRTC in Angular framework .. so when I tried to use the getSeekableBlob() and invokeSaveAsDialog() function on my code the following error pops up.
ERROR in src/app/components/record-rtc/record-rtc.component.ts(120,7): error TS2304: Cannot find name 'getSeekableBlob'. src/app/components/record-rtc/record-rtc.component.ts(122,10): error TS2304: Cannot find name 'invokeSaveAsDialog'.
Note that I have installed recordRTC using npm on my project and then I imported it as follows import * as RecordRTC from 'recordrtc';
export class RecordRtcComponent implements AfterViewInit { private stream: MediaStream; private recordRTC: any; @ViewChild('video', { static: false }) video: any
processVideo(audioVideoWebMURL) {
stopRecording() { // We use the mediaStream to relase the web cam and microphone let recordRTC = this.recordRTC; // Obtain the recorded video URL and provide it as an argument to "processVideo()" recordRTC.stopRecording(this.processVideo.bind(this)); let stream = this.stream;
}
}
Please advice if there is anything else I need to import or how I should use these function correctly on angular