【问题标题】:RTCDataChannel ready state stuck at connecting in chrome but working in FirefoxRTCDataChannel 就绪状态卡在 chrome 中连接但在 Firefox 中工作
【发布时间】:2017-09-06 12:53:00
【问题描述】:

我正在尝试实现RTCDataChannel(webRTC)。

它在 Firefox 中运行良好,但在 chrome 中却不行。

Chrome 和 Firefox 都是最新版本。

Chrome 中的 RTCDataChannel 对象:-

RTCDataChannel {
binaryType: "arraybuffer"
bufferedAmount: 0
bufferedAmountLowThreshold: 0
id: 65535
label: "sendDataChannel"
maxRetransmitTime: 65535
maxRetransmits: 65535
negotiated: false
onbufferedamountlow: null
onclose: null
onerror: ƒ (event)
onmessage: ƒ (event)
onopen: ƒ dataChannelStateChanged()
ordered: true
protocol: ""
readyState: "connecting"
reliable: false__proto__:}

Firefox 中的 RTCDataChannel 对象:-

DataChannel { 
binaryType: "blob"
id: 0
label: "sendDataChannel", 
reliable: true, 
readyState: "open",
bufferedAmount: 0, 
bufferedAmountLowThreshold: 0, 
onopen: dataChannelStateChanged(), 
onerror: create_peer_connection/dataChannel.onerror(), 
onclose: null, 
onmessage: create_peer_connection/dataChannel.onmessage(), 
onbufferedamountlow: null 
protocol:""
ordered:true}

我已经浏览了以下链接:-

  1. WebRTC data channel stack on readyState "conecting"
  2. WebRTC dataChannel.readyState stalling on "connecting"
  3. RTCDataChannel's ReadyState is not 'open'
  4. Webrtc Data Channel always in connecting state and not open

请提出 chrome 出现问题的原因可能是什么?

【问题讨论】:

    标签: javascript google-chrome webrtc rtcdatachannel


    【解决方案1】:

    我可以使用以下帖子解决它:

    WebRTC DataChannel: working in Firefox but not Chrome

    我必须改变

    pc = new RTCPeerConnection(configuration,
                    {optional: [{RtpDataChannels: true}]});
    

    pc = new RTCPeerConnection(configuration);
    

    【讨论】:

      猜你喜欢
      • 2011-03-05
      • 2023-03-05
      • 2019-02-27
      • 2021-07-10
      • 2011-03-16
      • 2020-05-11
      • 2016-01-19
      • 2018-06-03
      • 2016-04-18
      相关资源
      最近更新 更多