我想知道为什么在createAnswerWithDelegate
peerConnection 的信号状态之后永远不会更改为RTCSignalingHaveLocalPrAnswer
?调用跟踪是:
if(peerConnection.signalingState == RTCSignalingHaveRemoteOffer) {
NSLog(@"Setting Remote Offer desc");
[peerConnection createAnswerWithDelegate:self constraints:_constraints];
}
然后
-(void)peerConnection:(RTCPeerConnection *)peerConnection didCreateSessionDescription:(RTCSessionDescription *)sdp error:(NSError *)error
{
if(error) {
NSLog(@"Error - %@", error.description);
}
else {
NSLog(@"Setting Local Desc");
[peerConnection setLocalDescriptionWithDelegate:self sessionDescription:sdp];
}
}
然后在-(void)peerConnection:(RTCPeerConnection *)peerConnection didSetSessionDescriptionWithError:(NSError *)error
触发这种情况if(peerConnection.signalingState == RTCSignalingStable)
时,我必须手动创建答案并强制发送他。我究竟做错了什么?