Using PLAN_B for now to make it work with the old code

This commit is contained in:
ThomasSession 2024-08-09 17:03:23 +10:00 committed by fanchao
parent 84896f8d23
commit c3d928ed8c

View File

@ -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 {