streamlit-webrtc 0.53.2__py3-none-any.whl → 0.53.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -564,18 +564,22 @@ def webrtc_streamer(
564
564
  if component_value:
565
565
  sdp_offer = component_value.get("sdpOffer")
566
566
 
567
- if webrtc_worker and not context.state.playing and not context.state.signalling:
567
+ if not context.state.playing and not context.state.signalling:
568
568
  LOGGER.debug(
569
- "Unset the worker because the frontend state is "
569
+ "Unset the worker and the internal states because the frontend state is "
570
570
  'neither playing nor signalling (key="%s").',
571
571
  key,
572
572
  )
573
- webrtc_worker.stop()
574
- context._set_worker(None)
575
- webrtc_worker = None
576
573
 
577
- # Rerun to unset the SDP answer from the frontend args
578
- rerun()
574
+ context._frontend_rtc_configuration = None
575
+
576
+ if webrtc_worker:
577
+ webrtc_worker.stop()
578
+ context._set_worker(None)
579
+ webrtc_worker = None
580
+
581
+ # Rerun to unset the SDP answer from the frontend args
582
+ rerun()
579
583
 
580
584
  if webrtc_worker:
581
585
  if video_frame_callback or queued_video_frames_callback or on_video_ended: