From c09e08c7fde813d866647df38a9dcc727b98fb80 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 21 Nov 2017 10:57:28 +0100 Subject: [PATCH] Partially works Signed-off-by: Mario Danic --- .../java/com/nextcloud/talk/activities/CallActivity.java | 5 +---- .../com/nextcloud/talk/webrtc/PeerConnectionWrapper.java | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 42e08b393..23732e8e1 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -274,10 +274,7 @@ public class CallActivity extends AppCompatActivity { //we already have video and audio tracks. Now create peerconnections iceServers = new ArrayList<>(); - iceServers.add(new PeerConnection.IceServer("stun:stun.l.google.com:19302")); - //iceServers.add(new PeerConnection.IceServer("turn:mario:mario@172.104.225.9:3478")); - //iceServers.add(PeerConnection.IceServer.builder("http://172.104.225.9:3478").setUsername("mario").setPassword - // ("mario").createIceServer()); + iceServers.add(new PeerConnection.IceServer("stun:stun.nextcloud.com:443")); //create sdpConstraints sdpConstraints = new MediaConstraints(); diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java index 19c34ceae..ea1b82e57 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java @@ -153,8 +153,10 @@ public class PeerConnectionWrapper { EventBus.getDefault().post(new SessionDescriptionSendEvent(peerConnection.getLocalDescription(), sessionId, peerConnection.getLocalDescription().type.canonicalForm(), null)); } else { - drainIceCandidates(); - sendLocalCandidates(); + if (peerConnection.getRemoteDescription() != null) { + drainIceCandidates(); + sendLocalCandidates(); + } } }