尝试将 Android 应用程序用于基于 APPRtcDemo 的 WebRTC。 从 Chrome 34 连接时,一切正常,但是当我使用 Chrome 35 进行视频通话时,出现此错误。
onSetFailure: Failed to set remote offer sdp: Called with SDP without SDES crypto.
这里是我正在尝试使用的媒体限制
sdpMediaConstraints = new MediaConstraints();
sdpMediaConstraints.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true"));
sdpMediaConstraints.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true"));
sdpMediaConstraints.optional.add(new MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true"));
这里是代码设置远程描述
pc.setRemoteDescription(sdpObserver, new SessionDescription(
SessionDescription.Type.OFFER, description.toString()));
最佳答案
通过在 Peerconnection 对象的创建中添加约束来解决此问题。
DtlsSrtpKeyAgreement:true
pc = factory.createPeerConnection(iceServers, constraints, pcObserver);
其中 constraints 具有 DtlsSrtpKeyAgreement:true 键值。
关于android - 无法设置远程报价 sdp : Called with SDP without SDES crypto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24062340/