the constraints are not honored as of yet. You can follow the following issue (by "staring" it) to be informed of when it will become available.
By default, webrtc will start with a reasonable assumption of the available bandwidth and will then slowly use whatever is available up to 2Mb.
change 50 and 256 to whatever the bandwidth limit you want to be for audio and video streams, or make it an argument of the function if you want to make it more flexible (and potentially depend on prior hardware probing).
HTH, cheers.
alex.
//--------------------------------------------------------------------
// SDP Manipulation - full SDP
//
function limitBandwidth( sdp )
{
// split sdp message into an array.
// each element of the array is one line of the sdp
var sdpLines = sdp.split('\r\n');
// search for media, and then add bandwidth limit
// Search for m line.
for (var i = 0; i < sdpLines.length; i++)
if (sdpLines[i].search('m=') !== -1)
sdpLines = insertBandwidthLimit( sdpLines, i );
// reconstruct the SDP message
sdp = sdpLines.join('\r\n');
return sdp;
}
//--------------------------------------------------------------------
// SDP Manipulation - Multiple lines
//
function insertBandwidthLimit( sdpLines, index )
{
// compute limit depending on media type
var limit;
if( sdpLines[index].search('audio') !== -1 )
limit = '50';
else
limit = '256';
// create a new line
newLine = "b=AS:" + limit;
// insert the new line after the media line
sdpLines.splice(index+1,0,newLine);
return sdpLines;
}