本文整理汇总了Java中org.webrtc.PeerConnection.IceConnectionState方法的典型用法代码示例。如果您正苦于以下问题:Java PeerConnection.IceConnectionState方法的具体用法?Java PeerConnection.IceConnectionState怎么用?Java PeerConnection.IceConnectionState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.webrtc.PeerConnection
的用法示例。
在下文中一共展示了PeerConnection.IceConnectionState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iceConnectionStateString
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Nullable
private String iceConnectionStateString(PeerConnection.IceConnectionState iceConnectionState) {
switch (iceConnectionState) {
case NEW:
return "new";
case CHECKING:
return "checking";
case CONNECTED:
return "connected";
case COMPLETED:
return "completed";
case FAILED:
return "failed";
case DISCONNECTED:
return "disconnected";
case CLOSED:
return "closed";
}
return null;
}
示例2: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@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.");
}
}
});
}
示例3: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@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.");
}
}
});
}
示例4: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@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.");
// }
// }
// });
}
示例5: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(final PeerConnection.IceConnectionState iceConnectionState) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "@@@ onIceConnectionChange");
Log.d(TAG, "@@@ IceConnectionState: " + iceConnectionState.toString());
}
switch (iceConnectionState) {
case FAILED:
if (mCallback != null) {
mCallback.onError(MediaConnection.this);
}
// no break;
case DISCONNECTED:
close();
break;
default:
if (BuildConfig.DEBUG) {
Log.d(TAG, "@@@ iceConnectionState=" + iceConnectionState);
}
break;
}
}
示例6: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
WritableMap params = Arguments.createMap();
params.putInt("id", id);
params.putString("iceConnectionState", iceConnectionStateString(iceConnectionState));
webRTCModule.sendEvent("peerConnectionIceConnectionChanged", params);
}
示例7: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@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);
}
}
示例8: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
if(iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
removePeer(id);
mListener.onStatusChanged("DISCONNECTED");
}
}
示例9: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
Log.d(TAG, "Peer onIceConnectionChange");
if(iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
removePeer(id);
mListener.onStatusChanged("DISCONNECTED");
}
}
示例10: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(final PeerConnection.IceConnectionState state) {
Log.d("WebRTC", "IceConnectionState is " + state);
if (state == PeerConnection.IceConnectionState.CONNECTED) {
CallingActivity.this.state.changeValue(State.STREAMING);
progressState.changeValue(ProgressState.IDLE);
} else if (state == PeerConnection.IceConnectionState.CLOSED) {
finish();
}
}
示例11: handleCandidate
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
/**
* Handles a candidate message.
* @param json candidate message
*/
public void handleCandidate(final JSONObject json) {
if (BuildConfig.DEBUG) {
Log.d(TAG, "@@@@ handleCandidate");
Log.d(TAG, "@@@@ json: " + json.toString());
}
PeerConnection.IceConnectionState state = mPeerConnection.iceConnectionState();
if (state == PeerConnection.IceConnectionState.COMPLETED) {
return;
}
JSONObject payload = json.optJSONObject("payload");
JSONObject candidateObj = payload.optJSONObject("candidate");
String sdpMid = candidateObj.optString("sdpMid");
Integer sdpMLineIndex = candidateObj.optInt("sdpMLineIndex");
String candidate = candidateObj.optString("candidate");
IceCandidate ice = new IceCandidate(sdpMid, sdpMLineIndex, candidate);
boolean result = mPeerConnection.addIceCandidate(ice);
if (BuildConfig.DEBUG) {
if (!result) {
Log.i(TAG, "@@@ handleCandidate NG");
} else {
Log.i(TAG, "@@@ handleCandidate OK");
}
}
}
示例12: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState newState) {
Log.d(TAG, "IceConnectionState: " + newState);
for (NBMWebRTCPeer.Observer o : observers) {
o.onIceStatusChanged(newState, this);
}
}
示例13: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
if(iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
removePeer(id);
mListener.onStatusChanged("DESCONECTADO");
}
}
示例14: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@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());
}
}
}
示例15: onIceConnectionChange
import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
LogUtils.d("onIceConnectionChange");
}