End peer if ICE failed

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-12-09 20:50:10 +01:00
parent e1b844c669
commit 26c7a3455a

View File

@ -194,6 +194,9 @@ public class MagicPeerConnectionWrapper {
if (iceConnectionState.equals(PeerConnection.IceConnectionState.CONNECTED) && hasInitiated) { if (iceConnectionState.equals(PeerConnection.IceConnectionState.CONNECTED) && hasInitiated) {
sendChannelData(new DataChannelMessage("videoOn")); sendChannelData(new DataChannelMessage("videoOn"));
sendChannelData(new DataChannelMessage("audioOn")); sendChannelData(new DataChannelMessage("audioOn"));
} else if (iceConnectionState.equals(PeerConnection.IceConnectionState.FAILED)) {
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
.CLOSE_PEER, sessionId));
} }
} }