But there is a method setMaxIncomingBitrate in WebRtcTransport to configure that value after creation.
Looking to the example https://github.com/mkhahani/mediasoup-sample-app (featured in the mediasoup web page), I can see how ‘maxIncomingBitrate’ is set in the object that will be used later on to configure a new WebRtcTransport. That is, this property is set in a WebRtcTransportOptions object.
The question is: The example has a bug and maxIncomingBitrate is being ignored or documentation is incomplete and maxIncomingBitrate can be set in WebRtcTransportOptions?
Thanks in advance!
PD: I’ve just caught this inconsistency thanks to TypeScript
There is no maxIncomingBitrate, it’s set dynamically via setMaxIncomingBitrate(). May be the example you mean is indeed wrong. If you take a look to the mediasoup-demo, the maxIncomingBitrate in config.js is used later with setMaxIncomingBitrate().
Yep, but IMHO it will be better to have both options. Allow to configure it when transport is created and also, allow dynamic change with setMaxIncomingBitrate.
Hi @micaelgallego
I just saw your comment and got curious to know what is wrong with the approach? The maxIncomingBitrate is part of the configuration object that is not being passed directly to the transport but is used as an argument for setMaxIncomingBitrate().
If you use TypeScript, then the configuration object can not be with the type WebRtcTransportOptions because it will have additional properties.
Also, conceptually, maxIncomingBitrate is a configuration property like others in WebRtcTransportOptions. Then, IMHO, it could be included on it. But @ibc thinks that having a set method for it is the best way to communicate that it can be changed at any time. And it is perfect for me