public Peer(String id, int endPoint) { Log.d(TAG, "new Peer: " + id + " " + endPoint); this.pc = factory.createPeerConnection(iceServers, pcConstraints, this); this.id = id; this.endPoint = endPoint; pc.addStream(localMS); //, new MediaConstraints() mListener.onStatusChanged("CONNECTING"); } }
@Nullable public PeerConnection createPeerConnection( PeerConnection.RTCConfiguration rtcConfig, PeerConnection.Observer observer) { return createPeerConnection(rtcConfig, null /* constraints */, observer); }
public PeerConnection createPeerConnection(List<PeerConnection.IceServer> iceServers, MediaConstraints constraints, PeerConnection.Observer observer) { PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(iceServers); return createPeerConnection(rtcConfig, constraints, observer); }
/** * Deprecated. PeerConnection constraints are deprecated. Supply values in rtcConfig struct * instead and use the method without constraints in the signature. */ @Nullable @Deprecated public PeerConnection createPeerConnection(List<PeerConnection.IceServer> iceServers, MediaConstraints constraints, PeerConnection.Observer observer) { PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(iceServers); return createPeerConnection(rtcConfig, constraints, observer); }
@Nullable public PeerConnection createPeerConnection( List<PeerConnection.IceServer> iceServers, PeerConnection.Observer observer) { PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(iceServers); return createPeerConnection(rtcConfig, observer); }
@Nullable public PeerConnection createPeerConnection( PeerConnection.RTCConfiguration rtcConfig, PeerConnectionDependencies dependencies) { return createPeerConnection(rtcConfig, null /* constraints */, dependencies.getObserver()); }
public PeerConnection createPeerConnection() { Log.i(TAG, "Create PeerConnection ..."); PeerConnection.RTCConfiguration configuration = new PeerConnection.RTCConfiguration(new ArrayList<>()); PeerConnection connection = mPeerConnectionFactory.createPeerConnection(configuration, mPeerConnectionObserver); if (connection == null) { Log.e(TAG, "Failed to createPeerConnection !"); return null; } connection.addTrack(mVideoTrack); connection.addTrack(mAudioTrack); return connection; }
public DotPeer newPeer(String peerId, boolean local) { DotPeer peer = new DotPeer(this); peer.peerId = peerId; peer.local = local; if (_iceServers.size() == 0){ Log.i("lin","--lin--*lin*---> onClosed -> ice server error !!!!!!"); }else { Log.i("lin","--lin--*lin*---> onClosed -> ice server size " + _iceServers.size()); } PeerConnection.RTCConfiguration configuration = new PeerConnection.RTCConfiguration(_iceServers); configuration.bundlePolicy = MAXBUNDLE; configuration.rtcpMuxPolicy = REQUIRE; MediaConstraints constraints = DotEngineSDPFactory.connectionConstraints(); PeerConnection peerConnection = peerConnectionFactory.createPeerConnection(configuration,constraints,peer); peer.peerConnection = peerConnection; peers.put(peerId,peer); return peer; }
return factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
return factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
public void accept(OnStateChangeListener listener) { this.listener = listener; new Thread(() -> { connection = factory.createPeerConnection(Collections.emptyList(), new DefaultObserver() { @Override public void onIceGatheringChange(PeerConnection.IceGatheringState iceGatheringState) {
return factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
peerConnection = factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
peerConnection = factory.createPeerConnection(rtcConfig, pcConstraints, pcObserver);
iceServers.add(new PeerConnection.IceServer("stun:stun.l.google.com:19302")); peerConnection = peerConnectionFactory.createPeerConnection( iceServers, new MediaConstraints(),
mPeerConnection = mPeerConnectionFactory.createPeerConnection( iceServers, pcConstraints,
new Thread(() -> { log("creating PeerConnection"); connection = factory.createPeerConnection(Collections.emptyList(), new DefaultObserver() { @Override public void onIceGatheringChange(PeerConnection.IceGatheringState iceGatheringState) {