当前位置: 首页>>代码示例>>Java>>正文


Java PeerConnection.IceConnectionState方法代码示例

本文整理汇总了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;
}
 
开发者ID:angellsl10,项目名称:react-native-webrtc,代码行数:21,代码来源:PeerConnectionObserver.java

示例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.");
            }
        }
    });
}
 
开发者ID:nhancv,项目名称:nc-android-webrtcpeer,代码行数:17,代码来源:PeerConnectionClient.java

示例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.");
      }
    }
  });
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:17,代码来源:PeerConnectionClient.java

示例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.");
//					}
//				}
//			});
		}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:18,代码来源:PeerConnectionClient.java

示例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;
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:24,代码来源:MediaConnection.java

示例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);
}
 
开发者ID:angellsl10,项目名称:react-native-webrtc,代码行数:9,代码来源:PeerConnectionObserver.java

示例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);
    }
}
 
开发者ID:newbie007fx,项目名称:newwebrtc,代码行数:9,代码来源:PnPeer.java

示例8: onIceConnectionChange

import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    if(iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
        removePeer(id);
        mListener.onStatusChanged("DISCONNECTED");
    }
}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:8,代码来源:WebRtcClient.java

示例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");
    }
}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:9,代码来源:WebRtcClient.java

示例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();
  }
}
 
开发者ID:seamlik,项目名称:viska-android,代码行数:11,代码来源:CallingActivity.java

示例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");
        }
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:32,代码来源:MediaConnection.java

示例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);
    }
}
 
开发者ID:nubomedia-vtt,项目名称:webrtcpeer-android,代码行数:9,代码来源:NBMPeerConnection.java

示例13: onIceConnectionChange

import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
  if(iceConnectionState == PeerConnection.IceConnectionState.DISCONNECTED) {
    removePeer(id);
    mListener.onStatusChanged("DESCONECTADO");
  }
}
 
开发者ID:KashaMalaga,项目名称:UMA-AndroidWebRTC,代码行数:8,代码来源:WebRTCCliente.java

示例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());
        }
    }
}
 
开发者ID:respoke,项目名称:respoke-sdk-android,代码行数:33,代码来源:RespokeCall.java

示例15: onIceConnectionChange

import org.webrtc.PeerConnection; //导入方法依赖的package包/类
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
    LogUtils.d("onIceConnectionChange");
}
 
开发者ID:vuatovuanang,项目名称:WebRTC-VideoCall-Anrdoid,代码行数:5,代码来源:VideoCallActivity.java


注:本文中的org.webrtc.PeerConnection.IceConnectionState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。