public void execute(String peerId, JSONObject payload) throws JSONException { Log.d(TAG, "CreateOfferCommand"); Peer peer = peers.get(peerId); peer.pc.createOffer(peer, pcConstraints); } }
public void createOffer(MediaConstraints constraints) { this.peerConnection.createOffer(this,constraints); }
@Override public void run() { if (peerConnection != null && !isError) { Log.d(TAG, "PC Create OFFER"); isInitiator = true; peerConnection.createOffer(sdpObserver, sdpMediaConstraints); } } });
@Override public void run() { if (peerConnection != null && !isError) { Log.d(TAG, "PC Create OFFER"); isInitiator = true; peerConnection.createOffer(sdpObserver, sdpMediaConstraints); } } });
private void doCall() { MediaConstraints sdpMediaConstraints = new MediaConstraints(); peerConnection.createOffer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { Log.d(TAG, "onCreateSuccess: "); peerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); JSONObject message = new JSONObject(); try { message.put("type", "offer"); message.put("sdp", sessionDescription.description); sendMessage(message); } catch (JSONException e) { e.printStackTrace(); } } }, sdpMediaConstraints); }
private void connectToOtherPeer() { MediaConstraints sdpMediaConstraints = new MediaConstraints(); localPeerConnection.createOffer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { Log.d(TAG, "onCreateSuccess: "); localPeerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.setRemoteDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.createAnswer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { localPeerConnection.setRemoteDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); } }, sdpMediaConstraints); } }, sdpMediaConstraints); }
public void doStartCall() { logcatOnUI("Start Call, Wait ..."); if (mPeerConnection == null) { mPeerConnection = createPeerConnection(); } MediaConstraints mediaConstraints = new MediaConstraints(); mediaConstraints.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true")); mediaConstraints.mandatory.add(new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true")); mediaConstraints.optional.add(new MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true")); mPeerConnection.createOffer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { Log.i(TAG, "Create local offer success: \n" + sessionDescription.description); mPeerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); JSONObject message = new JSONObject(); try { message.put("userId", RTCSignalClient.getInstance().getUserId()); message.put("msgType", RTCSignalClient.MESSAGE_TYPE_OFFER); message.put("sdp", sessionDescription.description); RTCSignalClient.getInstance().sendMessage(message); } catch (JSONException e) { e.printStackTrace(); } } }, mediaConstraints); }
private void startStreamingVideo() { MediaStream mediaStream = factory.createLocalMediaStream("ARDAMS"); mediaStream.addTrack(videoTrackFromCamera); localPeerConnection.addStream(mediaStream); MediaConstraints sdpMediaConstraints = new MediaConstraints(); localPeerConnection.createOffer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { Log.d(TAG, "onCreateSuccess: "); localPeerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.setRemoteDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.createAnswer(new SimpleSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) { localPeerConnection.setRemoteDescription(new SimpleSdpObserver(), sessionDescription); remotePeerConnection.setLocalDescription(new SimpleSdpObserver(), sessionDescription); } }, sdpMediaConstraints); } }, sdpMediaConstraints); }
Log.d(LOG_TAG, "## createLocalStream(): !isIncoming() -> createOffer"); mPeerConnection.createOffer(new SdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) {
this.dataChannel = connection.createDataChannel("data", new DataChannel.Init()); this.dataChannel.registerObserver(this); connection.createOffer(new DefaultSdpObserver() { @Override public void onCreateSuccess(SessionDescription sessionDescription) {