以前我用 org.webrtc:google-webrtc:1.0.26885 很好,现在我切换到最新版本 1.0.27225。我在26885版本中使用PeerConnectionFactory的createPeerConnection方法创建了一个PeerConnection实例,它工作正常,但是在我切换到最新版本27225之后,方法createPeerConnection总是返回null。有人可以帮我解决这个问题吗?
房间服务器来自:https ://github.com/webrtc/apprtc,Signal服务器来自collider,来自apprtc/src/collider,NAT服务器来自https://github.com/coturn/coturn。所有的 android 客户端代码都来自https://github.com/Piasy/webrtc/tree/hack_webrtc/examples/androidapp/src/org/appspot/apprtc。
PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(signalingParameters.iceServers);
// TCP candidates are only useful when connecting to a server that supports
// ICE-TCP.
rtcConfig.tcpCandidatePolicy = PeerConnection.TcpCandidatePolicy.DISABLED;
rtcConfig.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE;
rtcConfig.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE;
rtcConfig.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY;
// Use ECDSA encryption.
rtcConfig.keyType = PeerConnection.KeyType.ECDSA;
// Enable DTLS for normal calls and disable for loopback calls.
rtcConfig.enableDtlsSrtp = !peerConnectionParameters.loopback;
rtcConfig.sdpSemantics = PeerConnection.SdpSemantics.UNIFIED_PLAN;
peerConnection = factory.createPeerConnection(rtcConfig, pcObserver);