From c3d928ed8cb6e034dbec220b8f621803f2b18050 Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Fri, 9 Aug 2024 17:03:23 +1000 Subject: [PATCH] Using PLAN_B for now to make it work with the old code --- .../thoughtcrime/securesms/webrtc/PeerConnectionWrapper.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.kt b/app/src/main/java/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.kt index 3d5caf1a1b..480ba24ae3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.kt @@ -64,6 +64,7 @@ class PeerConnectionWrapper(private val context: Context, val configuration = PeerConnection.RTCConfiguration(iceServers).apply { bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE + sdpSemantics = PeerConnection.SdpSemantics.PLAN_B if (relay) { iceTransportsType = PeerConnection.IceTransportsType.RELAY } @@ -74,10 +75,7 @@ class PeerConnectionWrapper(private val context: Context, newPeerConnection.setAudioPlayout(true) newPeerConnection.setAudioRecording(true) - // Calls to `addStream` are deprecated & cause errors so we must use `addTracks` when - // using `io.github.webrtc-sdk:android:114.5735.10` and newer. - newPeerConnection.addTrack(mediaStream.audioTracks[0]) - if (mediaStream.videoTracks.isNotEmpty()) newPeerConnection.addTrack(mediaStream.videoTracks[0]) + newPeerConnection.addStream(mediaStream) } init {