muaz-khan / MultiStreamsMixer

MultiStreamsMixer is a JavaScript library that allows you pass multiple streams (e.g. screen+camera or multiple-cameras) and get single stream.

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ondataavailable not firing

chrismpalmer opened this issue · comments

I am using webrtc and I haven't been able to successfully mix the peer streams and receive ondataavailable events?

In webrtc, when a new stream is added

if ( audioMixer ) {
audioMixer.appendStreams([event.stream]);
}

Once I do this there are no ondataavailable events. If I only add the local stream I get ondataavailable.

Thanks

I was able to configure MultiStreamMixer correctly. I am getting events firing from the local stream. But when I use MultiStreamMixer,

audioMixer.appendStreams([event.stream]);

Doesn't add the additional audio track. This new track does not show up in the file saved. Only localStream..

Update when I build MultiStreamsMixer with both the peer and the local stream it works.

If I appendStreams after construction it does not add audio,... looking like bug.

Adding stream after recording started , DOES NOT ADD stream to recording.

I'll fix it in the next release.

Relevant: muaz-khan/RecordRTC#536

My plans are:

  1. Always createMediaStreamDestination even if there is no audio-track
  2. Use createMediaStreamSource for every new audio-stream. Do not use createMediaStreamDestination again.

Actually I was still including the MultiStreamMixer.js from your website, I removed this references and now RecordRTC is using the patched( from your commit) internal MultiStreamMixer and it does seem to be recording. Thank you for being so attentive.

Do you know if this is possible to do headless on server? Local Stream really isn't too important because the idea is to record all the peer connections.

I was able to configure MultiStreamMixer correctly. I am getting events firing from the local stream. But when I use MultiStreamMixer,

@chrismpalmer
I'm sorry, how were you able to fire the ondataavalible event of mediaRecorder using the MultiStreamsMixer? I'm having the same issue...

Actually I was still including the MultiStreamMixer.js from your website, I removed this references and now RecordRTC is using the patched( from your commit) internal MultiStreamMixer and it does seem to be recording. Thank you for being so attentive.

@chrismpalmer Can you explain how you did this?