comparison libervia/web/pages/calls/_browser/webrtc.py @ 1563:e3449beac8d8

browser (calls): Add clear search + formatting
author Goffi <goffi@goffi.org>
date Thu, 17 Aug 2023 16:23:01 +0200
parents 7dbb131bbb9e
children bd3c880f4a47
comparison
equal deleted inserted replaced
1562:4afafce0c4c9 1563:e3449beac8d8
197 197
198 if state == "connected": 198 if state == "connected":
199 if self.on_connection_established_cb is not None: 199 if self.on_connection_established_cb is not None:
200 self.on_connection_established_cb() 200 self.on_connection_established_cb()
201 elif state == "failed": 201 elif state == "failed":
202 log.error("ICE connection failed. Check network connectivity and ICE configurations.") 202 log.error(
203 "ICE connection failed. Check network connectivity and ICE configurations."
204 )
203 elif state == "disconnected": 205 elif state == "disconnected":
204 log.warning("ICE connection was disconnected.") 206 log.warning("ICE connection was disconnected.")
205 if self.on_connection_lost_cb is not None: 207 if self.on_connection_lost_cb is not None:
206 self.on_connection_lost_cb() 208 self.on_connection_lost_cb()
207 209
265 267
266 peer_connection = window.RTCPeerConnection.new(rtc_configuration) 268 peer_connection = window.RTCPeerConnection.new(rtc_configuration)
267 peer_connection.addEventListener("track", self.on_track) 269 peer_connection.addEventListener("track", self.on_track)
268 peer_connection.addEventListener("negotiationneeded", self.on_negotiation_needed) 270 peer_connection.addEventListener("negotiationneeded", self.on_negotiation_needed)
269 peer_connection.addEventListener( 271 peer_connection.addEventListener(
270 "iceconnectionstatechange", 272 "iceconnectionstatechange", self.on_ice_connection_state_change
271 self.on_ice_connection_state_change
272 ) 273 )
273 peer_connection.addEventListener("icecandidate", self.on_ice_candidate) 274 peer_connection.addEventListener("icecandidate", self.on_ice_candidate)
274 peer_connection.addEventListener("icecandidateerror", self.on_ice_candidate_error) 275 peer_connection.addEventListener("icecandidateerror", self.on_ice_candidate_error)
275 peer_connection.addEventListener( 276 peer_connection.addEventListener(
276 "icegatheringstatechange", self.on_ice_gathering_state_change 277 "icegatheringstatechange", self.on_ice_gathering_state_change