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 23732e8e1..64d42991d 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -446,7 +446,8 @@ public class CallActivity extends AppCompatActivity { peerConnectionWrapper.addCandidate(iceCandidate); break; case "endOfCandidates": - //peerConnectionWrapper.drainIceCandidates(); + peerConnectionWrapper.drainIceCandidates(); + peerConnectionWrapper.sendLocalCandidates(); break; default: break; @@ -588,20 +589,30 @@ public class CallActivity extends AppCompatActivity { private void gotRemoteStream(MediaStream stream) { //we have remote video stream. add to the renderer. - if (stream.videoTracks.size() == 1 && stream.audioTracks.size() == 1) { - final VideoTrack videoTrack = stream.videoTracks.get(0); - AudioTrack audioTrack = stream.audioTracks.get(0); - runOnUiThread(new Runnable() { - @Override - public void run() { - try { - remoteRenderer = new VideoRenderer(fullScreenVideoView); - videoTrack.addRenderer(remoteRenderer); - } catch (Exception e) { - e.printStackTrace(); + if (stream.videoTracks.size() < 2 && stream.audioTracks.size() < 2) { + if (stream.videoTracks.size() == 1) { + + VideoTrack videoTrack = stream.videoTracks.get(0); + runOnUiThread(new Runnable() { + @Override + public void run() { + if (stream.videoTracks.size() == 1) { + try { + remoteRenderer = new VideoRenderer(fullScreenVideoView); + videoTrack.addRenderer(remoteRenderer); + } catch (Exception e) { + e.printStackTrace(); + } + } } - } - }); + }); + + } + + if (stream.audioTracks.size() == 1) { + AudioTrack audioTrack = stream.audioTracks.get(0); + Log.d("MARIO", "BL"); + } } } 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 ea1b82e57..46e589bd1 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java @@ -152,11 +152,9 @@ public class PeerConnectionWrapper { ("offer"))) { EventBus.getDefault().post(new SessionDescriptionSendEvent(peerConnection.getLocalDescription(), sessionId, peerConnection.getLocalDescription().type.canonicalForm(), null)); - } else { - if (peerConnection.getRemoteDescription() != null) { - drainIceCandidates(); - sendLocalCandidates(); - } + } else if (peerConnection.getRemoteDescription() != null) { + drainIceCandidates(); + sendLocalCandidates(); } }