首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用recordrtc录制Webrtc会议呼叫

使用recordrtc录制Webrtc会议呼叫
EN

Stack Overflow用户
提问于 2019-09-30 19:21:15
回答 1查看 1.6K关注 0票数 1

我正在使用Angular 7和WebRTC构建新的应用程序,并且我使用recordRTC.js来录制(音频和视频)我的问题是当我录制多个流时,只录制第一个流的音频。

代码语言:javascript
复制
public addStreamToRecorder(stream: MediaStream) 
{

  if (!this.recorder) 
     {
      this.recorder = RecordRTC([stream],{type: "video"});
      this.recorder.startRecording();
     } 
  else 
     {
      this.recorder.getInternalRecorder().addStreams([stream]);
     }
 }

经过调查,我发现appendStreams在reocrdrtc中的功能不能混音。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-03 17:10:54

我用我从MultiStreamRecorder (https://github.com/streamproc/MediaStreamRecorder)得到的最新版本更新了recordRTC中的appendStreams函数,修复了这个问题。

将recordRTC中的appendStreams替换为

代码语言:javascript
复制
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);
        }
    });
};
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58166881

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档