我设置了远程描述,回调didSetSessionDescriptionWithError
被击中,并显示错误:
- (void)processAnswer:(NSString *)sdpAnswer connectionId:(NSString *)connectionId {
//NSParameterAssert(sdpAnswer);
NSParameterAssert(connectionId);
NBMPeerConnection *connection = self.connectionMap[connectionId];
__block __weak RTCPeerConnection* peerConnection = connection.peerConnection;
RTCSessionDescription *description = [[RTCSessionDescription alloc] initWithType:RTCSdpTypeAnswer sdp:sdpAnswer];
[connection.peerConnection setRemoteDescription:description completionHandler:^(NSError * _Nullable error) {
[self peerConnection:peerConnection didSetSessionDescriptionWithError:error];
}];
}
在调用后得到此错误。
Error Domain = org.webrtc.RTCPeerConnection Code = -1“SessionDescription为NULL。”
我遇到了同样的错误并通过在Offer字符串的末尾添加“\ n”来修复它。希望这可以帮助。