尝试使用基于APpRtcDemo的WebRTC Android应用程序。 从Chrome 34连接时,Everythings工作正常,但当我使用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()));
答案 0 :(得分:3)
通过在创建Peerconnection对象时添加约束来解决问题。
DtlsSrtpKeyAgreement:true
pc = factory.createPeerConnection(iceServers, constraints, pcObserver);
其中约束具有 DtlsSrtpKeyAgreement:true 键值。