Adi Darachi
Adi Darachi

Reputation: 2175

limit WebRTC bandwidth from the client side (browser)

I know it's possible to limit the upload (sent) bandwidth using "setParameter" on the peer-connection. I'm looking for a way to limit the download (received) and couldn't find one. (I don't have control

Am I missing the concept? or there's a way to do it?

Thanks

Upvotes: 3

Views: 1047

Answers (2)

Philipp Hancke
Philipp Hancke

Reputation: 17360

This can be controlled by inserting a b= line into the SDP. Support for this varies, until recently Chrome only supported b=AS which specified the bandwidth in kilobits per second while Firefox only supported b=TIAS which specifies the bandwidth in bits per second. Both variants ask a remote peer not to send more than this bandwidth.

One of the webrtc samples still shows the usage but you will need to deactivate the newer usage of setParameters.

Upvotes: 0

jib
jib

Reputation: 42530

To "limit bandwidth" of realtime data means sending less of it.

There's no setParameters on an RTCRtpReceiver and no builtin back channel for this. But you can trivially make your own using e.g. createDataChannel("myBackchannel"), provided you have control of both sides. Then have the receiver send parameters back to the sender over it, which then sets them with setParameters.

Upvotes: 2

Related Questions