Listing producers/consumers associated with a given transport

Hi, mediasoup maintains a map of producers and consumers associated with a given transport, however it doesn’t seem to expose it. Can a getProducers()/getConsumers() or similar be exposed? I find that I end up manually maintaining this map anyways, so it would be nice to just use the one stored in the transport. Specifically, I often need the ability to enumerate all producer/consumer id’s to send to new clients and to look up producer/consumers by id for the various actions.

The application (the Node application) is supposed to hold and wrap mediasoup objects (transports, producers and consumers) on his own. We want to be very low level in mediasoup.

Isn’t it duplicitous to manage this separately? If the application has to maintain it, in order to be correct, it has to copy this block of code. I’ve already found that a few of the demos don’t do this correctly.

1 Like

It’s not duplicitous code. Your app may need to reference producers/consumers per transport or not. We expose an API and events for you to build the “container” you need, that’s up to your app.