无法在WebRTC上设置会话描述

时间:2016-09-26 07:08:51

标签: ios iphone video-streaming webrtc

我设置了远程描述,回调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 Code = -1“SessionDescription为NULL。”

1 个答案:

答案 0 :(得分:0)

我遇到了相同的错误,并通过在Offer字符串的末尾添加“ \ n”来解决该错误。希望这会有所帮助。