That was my initial idea actually. I now clearly see the benefit of not sending ever growing SDP back and forth, but I think such a library will work and solve most use cases just fine. This is basically what I already do anyway, just not as feature-complete as it probably should be.
I have a question about .consume() method though: is it needed there?
There is transport.observer.on(“newconsumer”, fn(consumer)) and receive endpoint can just subscribe to that and then fire negotiationneeded as the result of it without exposing additional API methods.
No, we cannot assume that the remote endpoint must consume everything that is produced in the Router. What to consume is up to the application, not up to mediasoup or mediasoup-sdp-bridge.
However, when using mediasoup-sdp-bridge, associated Producers are not created by calling transport.produce() but by calling sdpSendEndpoint.receiveOffer(sdp). So, to be symmetrical, I think it’s better to have a explicit method in sdpRecvEndpoint to consume.
Well, that can also be avoided because you can always use transport.observer.on(“newproducer”, fn(producer)) to get those producers. Not sure if that is more ergonomic though.
Ahh ok
In my case, I would use the proposed API to configure the GstWebrtc plugin, that needs plain SDP. For now I “manually” convert the textual SDP from/to JSON representation used by mediasoup. It is far for optimal.