我设置了远程描述,回调函数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];
}];
}
在调用后出现了此错误。
错误领域=org.webrtc.RTCPeerConnection,代码=-1,“SessionDescription为空。”
initWithType
后有检查过description
吗?不管怎样,看起来我正在使用另一个库,所以无法帮助你。 - Samuel Méndez