我设置了远程描述,击中了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];
}];
}
通话后收到此错误。
错误Domain = org.webrtc.RTCPeerConnection代码= -1“SessionDescription为NULL。”
最佳答案
我曾经遇到过同样的错误,并通过在Offer字符串的末尾添加“\n”来解决此错误。希望这可以帮助。
关于ios - 无法在WebRTC上设置 session 描述,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39696684/