Hi,
So I read the documentation and I see that there’s an event “bwe” on the transport that gives us a bandwidth estimation. I’ve added it in my code after looking at how it has been implemented in mediasoup-demo.
Before moving on, my code is a fork of the actual mediasoup-demo the only difference is that I have different skin on it, and I’ve disabled some unwanted features like chat etc. So
Here’s my code:
await transport.enableTraceEvent([ 'bwe' ]);
transport.on('trace', (trace) =>
{
logger.info(
'transport "trace" event [transportId:%s, trace.type:%s, trace:%o]',
transport.id, trace.type, trace);
if (trace.type === 'bwe' && trace.direction === 'out')
{
peer.notify(
'downlinkBwe',
{
desiredBitrate : trace.info.desiredBitrate,
effectiveDesiredBitrate : trace.info.effectiveDesiredBitrate,
availableBitrate : trace.info.availableBitrate
})
.catch(() => {});
}
});
I am not getting any logs on the server, or any events on the client side WebSocket messages. When are the ‘bwe’ events supposed to fire? The documentation is quite straight forward and I’ve replicated it to my best but no logs. Any help would be really appreciated.
Thanks.