2

尝试使用基于APPrtcDemo的Android应用程序进行WebRTC。从 Chrome 34 Everythings 连接时工作正常,但是当我使用 Chrome 35 进行视频通话时 f 出现此错误。

 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()));
4

1 回答 1

3

该问题已通过在 Peerconnection 对象的创建中添加约束来解决。

DtlsSrtpKeyAgreement:true


pc = factory.createPeerConnection(iceServers, constraints, pcObserver);

其中约束具有DtlsSrtpKeyAgreement:true键值。

于 2014-06-10T13:12:49.750 回答