ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.35k stars 413 forks source link

iceRestart option in createOffer #149

Open NarasimhaDo opened 5 years ago

NarasimhaDo commented 5 years ago

On network reconnection, we are trying to create an offer with a parameter : iceRestart : true. But, at the receiver user its throwing an error -> InvalidStateError: Failed to set remote offer sdp: Called in wrong state: kHaveLocalOffer. Basically, its trying to create a new offer instead of restarting the existing connection. What is the correct way to implement iceRestart in createOffer method?

usage :

self.constraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints: @[ [[RTCPair alloc] initWithKey:@"OfferToReceiveAudio" value:@"true"], [[RTCPair alloc] initWithKey:@"OfferToReceiveVideo" value:@"true"], [[RTCPair alloc] initWithKey:@"iceRestart" value:@"true"] ] optionalConstraints:nil];

    [_peerConnection createOfferWithDelegate:self constraints:self.constraints];