meetecho / janode

A Node.js adapter for the Janus WebRTC server
ISC License
98 stars 36 forks source link

Joining audiobridge is locked to opus codec only #41

Closed pawnnail closed 3 months ago

pawnnail commented 5 months ago

Have come across a problem where joining as a plain rtp with a codec other that opus is impossible. Being irrelevant whether a participant is plain rtp or not, it seems join() is missing the 'codec' param. In my case, I was trying to join as a plain rtp participant with pcmu or pcma.

The fix is trivial, just adding the codec param to the join method (and documentation) does the trick. Something like that:

async join({ room, ..., generate_offer, codec }) {
  const body = {
      request: REQUEST_JOIN,
      room,
    };
...
...
    if (typeof codec === 'string') body.codec = codec;
    if (typeof muted === 'boolean') body.muted = muted;
...
}

I hope I am not missing anything.