Fixed SmallWebRTCTransport to not use mid to decide if the transceiver should be sendrecv or not.

This commit is contained in:
Filipi Fuchter
2025-09-02 18:04:51 -03:00
parent ce7a0512f9
commit 49c1f0bd08

View File

@@ -387,9 +387,10 @@ class SmallWebRTCConnection(BaseObject):
def force_transceivers_to_send_recv(self):
"""Force all transceivers to bidirectional send/receive mode."""
for transceiver in self._pc.getTransceivers():
# For now, we only support sendrecv for camera audio and video (the first two transceivers)
if transceiver.mid == "0" or transceiver.mid == "1":
transceivers = self._pc.getTransceivers()
# For now, we only support sendrecv for camera audio and video (the first two transceivers)
for i, transceiver in enumerate(transceivers):
if i < 2: # First two transceivers (camera audio and video)
transceiver.direction = "sendrecv"
else:
transceiver.direction = "recvonly"