Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding candidates with only sdpMLineIndex #862

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/aiortc/rtcpeerconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,20 @@ async def addIceCandidate(self, candidate: RTCIceCandidate) -> None:
raise ValueError("Candidate must have either sdpMid or sdpMLineIndex")

for transceiver in self.__transceivers:
if candidate.sdpMid == transceiver.mid and not transceiver._bundled:
if (
candidate.sdpMid == transceiver.mid
or candidate.sdpMLineIndex == transceiver._get_mline_index()
) and not transceiver._bundled:
iceTransport = transceiver._transport.transport
await iceTransport.addRemoteCandidate(candidate)
return

if (
self.__sctp
and candidate.sdpMid == self.__sctp.mid
and (
candidate.sdpMid == self.__sctp.mid
or candidate.sdpMLineIndex == self.__sctp_mline_index
)
and not self.__sctp._bundled
):
iceTransport = self.__sctp.transport.transport
Expand Down