How are data channels negotiated between two peers with WebRTC?
问题 The WebRTC RTCPeerConnection interface has a createDataChannel method and an ondatachannel event handler. How do these interact? How do I create a single data channel that can be used to send/receive data between two peers? Also, the RTCDataChannelInit constructor has a negotiated field, which by default is set to false and says it results in the channel being announced in-band. What happens if it's set to true ? 回答1: Firstly: to create any data channel, the peers need to exchange an SDP