无法在WebRTC上设置会话描述

问题描述 投票:4回答:1

我设置了远程描述,回调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。”

ios iphone video-streaming webrtc
1个回答
0
投票

我遇到了同样的错误并通过在Offer字符串的末尾添加“\ n”来修复它。希望这可以帮助。

© www.soinside.com 2019 - 2024. All rights reserved.