Angular 使用recordrtc录制Webrtc会议通话
我正在使用Angular 7和WebRTC构建新的应用程序,我使用recordRTC.js来录制(音频和视频)我的问题是当我录制多个流时,只录制第一个流的音频Angular 使用recordrtc录制Webrtc会议通话,angular,webrtc,recordrtc,Angular,Webrtc,Recordrtc,我正在使用Angular 7和WebRTC构建新的应用程序,我使用recordRTC.js来录制(音频和视频)我的问题是当我录制多个流时,只录制第一个流的音频 public addStreamToRecorder(stream: MediaStream) { if (!this.recorder) { this.recorder = RecordRTC([stream],{type: "video"}); this.recorder.startReco
public addStreamToRecorder(stream: MediaStream)
{
if (!this.recorder)
{
this.recorder = RecordRTC([stream],{type: "video"});
this.recorder.startRecording();
}
else
{
this.recorder.getInternalRecorder().addStreams([stream]);
}
}
经过调查,我发现reocrdrtc中的appendStreams函数没有混合音频我通过使用最新版本更新recordRTC中的appendStreams函数解决了这个问题,我是从MultiStreamRecorder()获得的 将recordRTC中的appendStreams替换为
this.appendStreams = function (streams) {
if (!streams) {
throw 'First parameter is required.';
}
if (!(streams instanceof Array)) {
streams = [streams];
}
arrayOfMediaStreams.concat(streams);
streams.forEach(stream => {
if (stream.getTracks().filter(function (t) {
return t.kind === 'video';
}).length) {
var video = getVideo(stream);
video.stream = stream;
videos.push(video);
}
if (stream.getTracks().filter(function (t) {
return t.kind === 'audio';
}).length && this.audioContext) {
var audioSource = this.audioContext.createMediaStreamSource(stream);
audioSource.connect(this.audioDestination);
self.audioSources.push(audioSource);
}
});
};
你能分享更多细节吗。我不清楚音频上下文、音频目的地、音频源。如果您共享更详细的代码,这将很有帮助。