Open ghost opened 6 years ago
var recorder = RecordRTC([localStream], {
type: 'video'
});
recorder.startRecording();
// now call "appendRemoteVideo" whenever you have remote video
function appendRemoteVideo(stream) {
recorder.getInternalRecorder().addStreams([stream]);
}
Pass array of streams to RecordRTC. E.g.
var recorder = RecordRTC([localStream], {
type: 'video'
});
Call getInternalRecorder
method to access MultiStreamRecorder which has addStreams method:
peer.onaddstream = function(event) {
recorder.getInternalRecorder().addStreams([event.stream]);
};
recorder.getInternalRecorder() don't have the property 'addStreams'
Just came across the same issue while using MRecordRTC, I used:
recorder.videoRecorder.getInternalRecorder().addStreams([stream]);
I don't know if it's the same for RecordRTC
recorder.getInternalRecorder().addStreams([stream]);
recorder.videoRecorder.getInternalRecorder().addStreams([stream]);
Hi, I am using MRecordRTC and I can't add more streams, I need some help, please
controller.onLocalStream = function (stream){
recorder = new MRecordRTC();
recorder.mediaType = {
audio: true, // or StereoAudioRecorder
video: true, // or WhammyRecorder
};
recorder.mimeType = {
audio: 'audio/wav',
video: 'video/webm',
};
// This works
recorder.addStream(stream);
recorder.startRecording();
// This not works, Error recorder.videoRecorder.getInternalRecorder().addStreams is not a function (yes, I know I am adding the same stream one more time, it's just a test)
recorder.videoRecorder.getInternalRecorder().addStreams([stream]);
}
If I "console.log" my recorder.videoRecorder.getInternalRecorder() object, I get:
MediaStreamRecorder blob: null clearRecordedData: ƒ () getAllStates: ƒ () getArrayOfBlobs: ƒ () getInternalRecorder: ƒ () getState: ƒ () name: "MediaStreamRecorder" pause: ƒ () record: ƒ () resume: ƒ () stop: ƒ (callback) timestamps: [] toString: ƒ () proto: Object
Thanks for any help
Use RecordRTC function MultiStreamRecorder, this will be work.
let options = {
mimeType: 'video/mp4', }; let arrayOfStreams = [this.localStream.data, this.remoteStream.data]; this.recorder = new RecordRTC.MultiStreamRecorder(arrayOfStreams, options); this.recorder.record();
Is it possible to record both remote and local video+audio at a time to node js folder