【问题标题】:WebRTC + Adapter.js giving addremoteCandidate error while connecting audio call in MS EdgeWebRTC + Adapter.js 在 MS Edge 中连接音频呼叫时出现 addremoteCandidate 错误
【发布时间】:2019-08-03 16:10:34
【问题描述】:

我正在尝试使用 webrtc 和 adapter.js 在 MS Edge 中通过 sipML5 API 连接音频呼叫,但它给出了错误 addremoteCandidate 超时。考虑发送候选人结束通知。

我已经尝试过发送 here 中提到的 addIceCandidate(null) 但它不起作用或者我发送错误。我用谷歌搜索,但没有足够的文档。

我的问题是我可以在哪里以及如何发送 addIceCandidate(null) 以便 adapter.js 会考虑它?

我的 RTCPeerConnection 代码

this.o_pc = new window.RTCPeerConn(a && !a.length ? null : {
            iceServers: a, 
            rtcpMuxPolicy: "negotiate",
            iceTransportPolicy: "all",
            bundlePolicy: "balanced",
            iceCandidatePoolSize: 0
            //gatherPolicy: "all",

        }, this.o_media_constraints);
        this.o_pc.onicecandidate = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onIceCandidate : function(e) {
            tmedia_session_jsep01.onIceCandidate(e, c);
        };
        this.o_pc.onnegotiationneeded = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onNegotiationNeeded : function(e) {
            tmedia_session_jsep01.onNegotiationNeeded(e, c);
        };
        this.o_pc.onsignalingstatechange = tmedia_session_jsep01.mozThis ? tmedia_session_jsep01.onSignalingstateChange : function(e) {
            tmedia_session_jsep01.onSignalingstateChange(e, c);
        };
this.o_media_constraints = {
        audio: true
    };
    if (tsk_utils_get_navigator_friendly_name() == "firefox") {
        tmedia_session_jsep01.mozThis = this;
        this.o_media_constraints.mandatory.MozDontOfferDataChannel = true;
    }

任何帮助将不胜感激。

谢谢

【问题讨论】:

  • 你可以参考this issue in GitHub添加end-of-candidate。在MDN doc 中,它说 如果没有指定候选对象,或者它的值为 null,则使用 end-of-candidates a-line 将一个 end-of-candidates 信号发送到远程对等体,格式化就像这样:a=end-of-candidates.
  • 您好,我无法在 safari working demo 上听到音频,您认为这与此问题有关吗?

标签: webrtc microsoft-edge ortc sipml5


【解决方案1】:

此警告表明您从不调用 addIceCandidate(null)。 当另一端完成候选人收集时,即调用 pc.oniceccandidate(event) event.candidate not set。然后你需要发送一个信令消息,例如{type: 'end-of-candidates'} 这将导致在 Edge 中调用 addIceCandidate(null)。

如果您不这样做,adapter.js(或者更确切地说是 Edge/ORTC shim)会在一段时间后为您执行此操作,但这远非最佳。

【讨论】:

  • 感谢here is the working demo的回答。如果您在 MS edge 上打开它,呼叫正在连接但没有音频,它与 addIceCandidate(null) 相关吗?这适用于除 MS edge 之外的所有浏览器(不是此版本)。
猜你喜欢
  • 2021-02-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-29
  • 1970-01-01
  • 1970-01-01
  • 2021-01-17
  • 2021-12-31
相关资源
最近更新 更多