I created a webrtc android application using libjinge library, my issue is unable to reconnect after a network failure,In browser used 'icerestart', how to ICE Restart in Android peerconnection client?
Asked
Active
Viewed 746 times
1
-
It will be very helpful if you make my answer an accepted answer. – Kathan Patel Oct 20 '21 at 19:55
1 Answers
3
As the android peer connection object doesn't have any icerestart()
method we have to do a workaround in our code to re-establish the connection.
Steps should be:
- Put additional constraint:
constraints.mandatory.add(new MediaConstraints.KeyValuePair("IceRestart","true"));
- Create offer again using that constraints:
peerConnection.createOffer(new YourSdpObserver(),constraints);
- Set generated sdp to peerConnection using setLocalDescription.:
peerConnection.setLocalDescription(new YourSdpObserver(),sdp);
- Send it to the remote peer.

Kathan Patel
- 368
- 3
- 11