简体   繁体   中英

When to Edit SDP Messages for WebRTC Connections

I'm following a Stack Overflow post on improving audio quality in WebRTC:

Is it really possible for webRTC to stream high quality audio without noise?

In the one answer, they edit the message between createAnswer() and setLocalDescription()

However this article on limiting bandwidth of WebRTC connections says "we are not allowed to modify the offer between createOffer (or createAnswer) and setLocalDescription"

https://webrtchacks.com/limit-webrtc-bandwidth-sdp/

So my question is: which is correct?

The specification says you are not allowed to do modify the description between createOffer/createAnswer. For a number of historical reasons browsers do allow "SDP munging" however.

What is allowed (and impossible to forbid by the specification) is modification of the SDP before setRemoteDescription as described in the webrtchacks article. Please note that these days the setParameters API as demonstrated by this sample

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM