Ich experimentiere mit der WebTRC-IOS-Bibliothek. Ich habe https://cocoapods.org/pods/webrtc-framework versucht und https://cocoapods.org/pods/WebRTCRTCPeerConnectionFactory.peerConnectionWithConfiguration verursacht Absturz des IOS-Simulators
Jedes Mal, wenn ich versuche, einen RTCPeerConnection zu initialisieren und zu einem lokalen Variablen zuweisen, die App stürzt ab. mit EXC_BAD_ACCESS Fehlercode.
Hier ist mein Code:
@interface WebRTCDelegate()
@property (nonatomic, strong) SRWebSocket* webSocket;
@property(nonatomic) RTCPeerConnection *peerConnection;
@end
@implementation WebRTCDelegate
...
- (void)initRTCPeerConnection
{
NSArray<RTCIceServer *> *iceServers = [NSArray arrayWithObjects:[[RTCIceServer alloc] initWithURLStrings:[NSArray arrayWithObjects:@"stun:stun.services.mozilla.com", nil]], [[RTCIceServer alloc] initWithURLStrings:[NSArray arrayWithObjects:@"stun:stun.l.google.com:19302", nil]] , nil];
RTCConfiguration *config = [[RTCConfiguration alloc] init];
[config setIceServers:iceServers];
NSDictionary *mandatoryConstraints = @{
@"OfferToReceiveAudio" : @"true",
@"OfferToReceiveVideo" : @"true",
};
RTCMediaConstraints* constraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:mandatoryConstraints optionalConstraints:nil];
RTCPeerConnectionFactory *pcFactory = [[RTCPeerConnectionFactory alloc] init];
_peerConnection = [pcFactory peerConnectionWithConfiguration:config constraints:constraints delegate:self];
}
...
@end
Dies ist der Fehler:
0x108895cbd <+115>: movq 0x38(%rax), %r13
0x108895cc1 <+119>: leaq 0x4f1891(%rip), %rsi ; "OnMessage"
0x108895cc8 <+126>: leaq 0x4f1894(%rip), %rdx ; "../../webrtc/base/rtccertificategenerator.cc:69"
Gibt es etwas falsch mit meinem Code?
Danke!
Versuchen Sie, die Factory als Instanzvariable beizubehalten. –
Was bedeutet das? – Ian