streamlit-webrtc 0.60.0__py3-none-any.whl → 0.60.1__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.
@@ -481,7 +481,7 @@ def webrtc_streamer(
481
481
  webrtc_worker = context._get_worker()
482
482
 
483
483
  sdp_answer_json = None
484
- if webrtc_worker:
484
+ if webrtc_worker and webrtc_worker.pc.localDescription:
485
485
  sdp_answer_json = json.dumps(
486
486
  {
487
487
  "sdp": webrtc_worker.pc.localDescription.sdp,
@@ -635,12 +635,19 @@ def webrtc_streamer(
635
635
  sendback_video=sendback_video,
636
636
  sendback_audio=sendback_audio,
637
637
  )
638
+
639
+ # Setting the worker here before calling `webrtc_worker.process_offer()` is important.
640
+ # `webrtc_worker.process_offer()` waits for processing the offer in another thread and
641
+ # a new script run can be triggered during it.
642
+ # so, if the worker is not set here, `context._get_worker()` will return None in the next run
643
+ # and it leads to creating a worker in the next run again.
644
+ context._set_worker(webrtc_worker)
645
+
638
646
  webrtc_worker.process_offer(sdp_offer["sdp"], sdp_offer["type"], timeout=None)
639
647
 
640
648
  if ice_candidates:
641
649
  webrtc_worker.set_ice_candidates_from_offerer(ice_candidates)
642
650
 
643
- context._set_worker(webrtc_worker)
644
651
  # Rerun to send the SDP answer to frontend
645
652
  rerun()
646
653
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamlit-webrtc
3
- Version: 0.60.0
3
+ Version: 0.60.1
4
4
  Summary: Real-time video and audio processing on Streamlit
5
5
  Project-URL: Repository, https://github.com/whitphx/streamlit-webrtc
6
6
  Author-email: "Yuichiro Tachibana (Tsuchiya)" <t.yic.yt@gmail.com>
@@ -1,6 +1,6 @@
1
1
  streamlit_webrtc/__init__.py,sha256=jMWwXoQ9hVyYXPD4Vrps7MyiR9goyC-n7LtkZNFBOxU,2273
2
2
  streamlit_webrtc/_compat.py,sha256=AVRcUGdgWDQcCE7-ufhGr6Hb5P6EHLgejUAA72ArJmg,4384
3
- streamlit_webrtc/component.py,sha256=1RHnnoGdWkEoKUWyvVTMe-oAa0h0kF93y29jNn_jg9M,26378
3
+ streamlit_webrtc/component.py,sha256=uNmy3kLxhT6vlIp61uMgAjqeS4PaaPMy9choGIHvENE,26832
4
4
  streamlit_webrtc/components_callbacks.py,sha256=tdrj2TlV8qcexFEdjm4PVkz8JwHffo4A8imoXOtjNHA,2401
5
5
  streamlit_webrtc/config.py,sha256=yKFIVjIoX2F62_G2qcDrNYm2Qe_qx1E9E0YqAnAibMo,5544
6
6
  streamlit_webrtc/credentials.py,sha256=3IOk7w1JLQ2Qs6XFP9dxsF81lpjLL2kdRe2ZIhHvaj4,4562
@@ -19,7 +19,7 @@ streamlit_webrtc/source.py,sha256=haPqMZ50Xh8tg7Z1yN8Frfk8v7D3oOuKteaD59asbzs,22
19
19
  streamlit_webrtc/webrtc.py,sha256=etDct0ONUDe-A02tv1la2VV2eqViafwuk3JPy1gALsk,29406
20
20
  streamlit_webrtc/frontend/dist/index.html,sha256=Iw2ulM_HTlCdchAUJLCBiZQk6FboupXx3g-5Zf4MrUQ,527
21
21
  streamlit_webrtc/frontend/dist/assets/index-DV2u3ooX.js,sha256=HpCe_touce0s9XRRQEB9PvmcIz5705ePMym6FB8sLFg,583792
22
- streamlit_webrtc-0.60.0.dist-info/METADATA,sha256=4_ZLBC8eJWAgyEZFV4B0KZFjkfOyaHuTPFM9NEFSGx8,18670
23
- streamlit_webrtc-0.60.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- streamlit_webrtc-0.60.0.dist-info/licenses/LICENSE,sha256=pwccNHVA7r4rYofGlMU10aKEU90GLUlQr8uY80PR0NQ,1081
25
- streamlit_webrtc-0.60.0.dist-info/RECORD,,
22
+ streamlit_webrtc-0.60.1.dist-info/METADATA,sha256=B7VRhUa-4QzL_Yf2IZu7pB45qPYiP-OSU4JRrNp75wk,18670
23
+ streamlit_webrtc-0.60.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ streamlit_webrtc-0.60.1.dist-info/licenses/LICENSE,sha256=pwccNHVA7r4rYofGlMU10aKEU90GLUlQr8uY80PR0NQ,1081
25
+ streamlit_webrtc-0.60.1.dist-info/RECORD,,