Java Code Examples for org.webrtc.PeerConnection#IceConnectionState

The following examples show how to use org.webrtc.PeerConnection#IceConnectionState . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: P2PPeerConnectionChannel.java    From owt-client-android with Apache License 2.0 6 votes vote down vote up
@Override
public void onIceConnectionChange(
        final PeerConnection.IceConnectionState iceConnectionState) {
    callbackExecutor.execute(() -> {
        Log.d(LOG_TAG, "onIceConnectionChange " + iceConnectionState);
        P2PPeerConnectionChannel.this.iceConnectionState = iceConnectionState;
        if (iceConnectionState == CONNECTED || iceConnectionState == COMPLETED) {
            checkWaitingList();
        }
        if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
            for (RemoteStream remoteStream : remoteStreams.values()) {
                remoteStream.onEnded();
            }
            for (Publication publication : publications) {
                publication.onEnded();
            }
            remoteStreams.clear();
            publications.clear();
        }
    });
}
 
Example 2
Source File: PeerConnectionClient.java    From voip_android with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void onIceConnectionChange(final PeerConnection.IceConnectionState newState) {
    executor.execute(new Runnable() {
        @Override
        public void run() {
            Log.d(TAG, "IceConnectionState: " + newState);
            if (newState == IceConnectionState.CONNECTED) {
                events.onIceConnected();
            } else if (newState == IceConnectionState.DISCONNECTED) {
                events.onIceDisconnected();
            } else if (newState == IceConnectionState.FAILED) {
                reportError("ICE connection failed.");
            }
        }
    });
}
 
Example 3
Source File: WebRtcClient.java    From imsdk-android with MIT License 6 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    if (iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
        removePeer();
        if(mListener != null)
            mListener.onStatusChanged(WebRTCStatus.DISCONNECT);
    } else if(iceConnectionState == PeerConnection.IceConnectionState.CONNECTED) {
        if(mListener != null)
            mListener.onStatusChanged(WebRTCStatus.CONNECT);
    }
    else if(iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
        if(mListener != null)
            mListener.onStatusChanged(WebRTCStatus.CONNECTING);
    }
    Logger.d(TAG + "  ice change :"+iceConnectionState);
}
 
Example 4
Source File: RespokeCall.java    From respoke-sdk-android with MIT License 5 votes vote down vote up
@Override public void onIceConnectionChange(
        PeerConnection.IceConnectionState newState) {
    if (isActive()) {
        if (newState == PeerConnection.IceConnectionState.CONNECTED) {
            Log.d(TAG, "ICE Connection connected");
        } else if (newState == PeerConnection.IceConnectionState.FAILED) {
            Log.d(TAG, "ICE Connection FAILED");

            if (null != listenerReference) {
                // Disconnect will clear the listenerReference, so grab a reference to the
                // listener while it's still alive since the listener will be notified in a
                // different (UI) thread
                final Listener listener = listenerReference.get();

                if (null != listener) {
                    new Handler(Looper.getMainLooper()).post(new Runnable() {
                        public void run() {
                            if (isActive()) {
                                listener.onError("ICE Connection failed!", RespokeCall.this);
                                listener.onHangup(RespokeCall.this);
                            }
                        }
                    });
                }
            }

            disconnect();
        } else {
            Log.d(TAG, "ICE Connection state: " + newState.toString());
        }
    }
}
 
Example 5
Source File: PnPeer.java    From AndroidRTC with MIT License 5 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    if (this.status.equals(STATUS_DISCONNECTED)) return; // Already hung up on.
    if (iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
        pcClient.removePeer(id); // TODO: Ponder. Also, might want to Pub a disconnect.
        setStatus(STATUS_DISCONNECTED);
    }
}
 
Example 6
Source File: PnPeer.java    From android-webrtc-api with MIT License 5 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    if (this.status.equals(STATUS_DISCONNECTED)) return; // Already hung up on.
    if (iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
        pcClient.removePeer(id); // TODO: Ponder. Also, might want to Pub a disconnect.
        setStatus(STATUS_DISCONNECTED);
    }
}
 
Example 7
Source File: PeerConnectionObserver.java    From iGap-Android with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void onIceConnectionChange(final PeerConnection.IceConnectionState iceConnectionState) {
    Log.i("WWW", "onIceConnectionChange : " + iceConnectionState);
    if (G.iSignalingCallBack != null) {
        if (iceConnectionState == CLOSED || iceConnectionState == DISCONNECTED) {
            G.iSignalingCallBack.onStatusChanged(CallState.DISCONNECTED);
        } else if (iceConnectionState == FAILED) {
            G.iSignalingCallBack.onStatusChanged(CallState.FAILD);
        } else if (iceConnectionState == CHECKING) {
            G.iSignalingCallBack.onStatusChanged(CallState.CONNECTING);
        } else if (iceConnectionState == CONNECTED || iceConnectionState == COMPLETED) {
            G.iSignalingCallBack.onStatusChanged(CallState.CONNECTED);
        }
    }
}
 
Example 8
Source File: NBMPeerConnection.java    From webrtcpeer-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState newState) {
    Log.d(TAG, "IceConnectionState: " + newState);

    for (NBMWebRTCPeer.Observer o : observers) {
        o.onIceStatusChanged(newState, this);
    }
}
 
Example 9
Source File: CallActivity.java    From RTCStartupDemo with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    Log.i(TAG, "onIceConnectionChange: " + iceConnectionState);
}
 
Example 10
Source File: PeerConnectionAdapter.java    From webrtc-android-tutorial with Apache License 2.0 4 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    log("onIceConnectionChange " + iceConnectionState);
}
 
Example 11
Source File: PeerConnectionChannel.java    From owt-client-android with Apache License 2.0 4 votes vote down vote up
@Override
abstract public void onIceConnectionChange(
        PeerConnection.IceConnectionState iceConnectionState);
 
Example 12
Source File: AppRTCDemoActivity.java    From WebRTCDemo with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override public void onIceConnectionChange(
    PeerConnection.IceConnectionState newState) {
}
 
Example 13
Source File: AppRTCDemoActivity.java    From droidkit-webrtc with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override public void onIceConnectionChange(
    PeerConnection.IceConnectionState newState) {
}
 
Example 14
Source File: PeerConnectionAdapter.java    From webrtc-android-tutorial with Apache License 2.0 4 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    log("onIceConnectionChange " + iceConnectionState);
}
 
Example 15
Source File: MainActivity.java    From krankygeek with MIT License 4 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    Log.d("RTCAPP", "onIceConnectionChange:" + iceConnectionState.toString());
}
 
Example 16
Source File: PeerConnectionAdapter.java    From webrtc-android-tutorial with Apache License 2.0 4 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    log("onIceConnectionChange " + iceConnectionState);
}
 
Example 17
Source File: VideoChatHelper.java    From Socket.io-FLSocketIM-Android with MIT License 2 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {

}
 
Example 18
Source File: Peer.java    From webrtc_android with MIT License 2 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState newState) {

}
 
Example 19
Source File: DefaultObserver.java    From Meshenger with GNU General Public License v3.0 2 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {

}
 
Example 20
Source File: DefaultObserver.java    From meshenger-android with GNU General Public License v3.0 2 votes vote down vote up
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {

}