Skip to content

Commit

Permalink
Merge pull request #17 from gabrielmatau79/fix/enable-iceservers-tran…
Browse files Browse the repository at this point in the history
…sport

fix: 🐛 Fix bug regarding the activation of the iceServer
  • Loading branch information
skymaze authored Sep 20, 2024
2 parents bf61434 + 1329334 commit 02bed7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pymediasoup/handlers/aiortc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
RTCSessionDescription,
RTCRtpTransceiver,
MediaStreamTrack,
RTCConfiguration
)
import sdp_transform
from .sdp import common_utils
Expand Down Expand Up @@ -165,7 +166,10 @@ def run(
"video", options.extendedRtpCapabilities
),
}
self._pc = RTCPeerConnection()

configuration = RTCConfiguration(iceServers=iceServers)

self._pc = RTCPeerConnection(configuration=configuration)

@self._pc.on("iceconnectionstatechange")
def on_iceconnectionstatechange():
Expand Down
2 changes: 1 addition & 1 deletion pymediasoup/handlers/handler_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run(
dtlsParameters: DtlsParameters,
extendedRtpCapabilities: ExtendedRtpCapabilities,
sctpParameters: Optional[SctpParameters] = None,
iceServers: Optional[RTCIceServer] = None,
iceServers: Optional[List[RTCIceServer]] = None,
iceTransportPolicy: Optional[Literal["all", "relay"]] = None,
additionalSettings: Optional[Any] = None,
proprietaryConstraints: Optional[Any] = None,
Expand Down
2 changes: 1 addition & 1 deletion pymediasoup/models/handler_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HandlerRunOptions(BaseModel):
iceCandidates: List[IceCandidate]
dtlsParameters: DtlsParameters
sctpParameters: Optional[SctpParameters]
iceServers: Optional[RTCIceServer]
iceServers: Optional[List[RTCIceServer]]
iceTransportPolicy: Optional[Literal["all", "relay"]]
additionalSettings: Optional[Any]
proprietaryConstraints: Optional[Any]
Expand Down

0 comments on commit 02bed7c

Please sign in to comment.