node-webrtc-examples icon indicating copy to clipboard operation
node-webrtc-examples copied to clipboard

Where i can apply bitrate?

Open savsofts opened this issue 4 years ago • 1 comments

How i can control maximum streaming bandwidth? I tried to apply sdp.replace method in index.js file ( node-webrtc-examples/lib/client/index.js ) but no effect..

savsofts avatar Apr 22 '20 14:04 savsofts

I also tried to add following code in webrtcconnection.js file (node-webrtc-examples/lib/server/connections/ )

` const offer = await peerConnection.createOffer(); offer.sdp=setBitrate(offer.sdp);

function setBitrate(sdp){ sdp = sdp .replace(/a=mid:audio\r\n/g, 'a=mid:audio\r\nb=AS:64\r\n'); sdp = sdp .replace(/a=mid:video\r\n/g, 'a=mid:video\r\nb=AS:256\r\n'); return sdp; } `

savsofts avatar Apr 22 '20 15:04 savsofts