Regino commited on
Commit
6f5fce0
·
1 Parent(s): f9b42e1
Files changed (1) hide show
  1. src/streamlit_app.py +12 -2
src/streamlit_app.py CHANGED
@@ -151,11 +151,21 @@ webrtc_ctx = webrtc_streamer(
151
  media_stream_constraints={"video": True, "audio": False}, # Only video, no audio
152
  async_processing=True, # Process frames asynchronously
153
  # desired_playing_state={"playing": True}, # Optional: tries to auto-start. Can comment out.
 
 
 
 
 
 
 
 
 
 
 
154
  )
155
 
156
  # Provide feedback based on the stream state
157
  if webrtc_ctx.state.playing:
158
  st.success("Webcam stream active. Looking for faces...")
159
  else:
160
- st.info("Webcam stream not active. Click the 'Start' button above to begin, and allow camera access.")
161
-
 
151
  media_stream_constraints={"video": True, "audio": False}, # Only video, no audio
152
  async_processing=True, # Process frames asynchronously
153
  # desired_playing_state={"playing": True}, # Optional: tries to auto-start. Can comment out.
154
+
155
+ # --- ADD THIS LINE HERE ---
156
+ rtc_configuration={"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]},
157
+ # You can add more STUN servers for redundancy if needed, like:
158
+ # rtc_configuration={
159
+ # "iceServers": [
160
+ # {"urls": ["stun:stun.l.google.com:19302"]},
161
+ # {"urls": ["stun:stun1.l.google.com:19302"]},
162
+ # {"urls": ["stun:stun.services.mozilla.com"]}
163
+ # ]
164
+ # },
165
  )
166
 
167
  # Provide feedback based on the stream state
168
  if webrtc_ctx.state.playing:
169
  st.success("Webcam stream active. Looking for faces...")
170
  else:
171
+ st.info("Webcam stream not active. Click the 'Start' button above to begin, and allow camera access.")