diff --git a/inference/core/interfaces/stream_manager/manager_app/entities.py b/inference/core/interfaces/stream_manager/manager_app/entities.py index 8b017c0d9..c5c4e3022 100644 --- a/inference/core/interfaces/stream_manager/manager_app/entities.py +++ b/inference/core/interfaces/stream_manager/manager_app/entities.py @@ -99,7 +99,7 @@ class WebRTCTURNConfig(BaseModel): class InitialiseWebRTCPipelinePayload(InitialisePipelinePayload): webrtc_offer: WebRTCOffer - webrtc_turn_config: WebRTCTURNConfig + webrtc_turn_config: Optional[WebRTCTURNConfig] = None stream_output: Optional[List[str]] = Field(default_factory=list) data_output: Optional[List[str]] = Field(default_factory=list) webrtc_peer_timeout: float = 1 diff --git a/inference/core/interfaces/stream_manager/manager_app/webrtc.py b/inference/core/interfaces/stream_manager/manager_app/webrtc.py index dd5288980..8e92b0873 100644 --- a/inference/core/interfaces/stream_manager/manager_app/webrtc.py +++ b/inference/core/interfaces/stream_manager/manager_app/webrtc.py @@ -228,15 +228,20 @@ async def init_rtc_peer_connection( webcam_fps=webcam_fps, ) - turn_server = RTCIceServer( - urls=[webrtc_turn_config.urls], - username=webrtc_turn_config.username, - credential=webrtc_turn_config.credential, - ) - peer_connection = RTCPeerConnectionWithFPS( - video_transform_track=video_transform_track, - configuration=RTCConfiguration(iceServers=[turn_server]), - ) + if webrtc_turn_config: + turn_server = RTCIceServer( + urls=[webrtc_turn_config.urls], + username=webrtc_turn_config.username, + credential=webrtc_turn_config.credential, + ) + peer_connection = RTCPeerConnectionWithFPS( + video_transform_track=video_transform_track, + configuration=RTCConfiguration(iceServers=[turn_server]), + ) + else: + peer_connection = RTCPeerConnectionWithFPS( + video_transform_track=video_transform_track, + ) relay = MediaRelay() @peer_connection.on("track")