Martlgap commited on
Commit
700c1e0
1 Parent(s): db798b9

added STUN

Browse files
Files changed (2) hide show
  1. .DS_Store +0 -0
  2. tools/webcam.py +7 -0
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
tools/webcam.py CHANGED
@@ -2,11 +2,17 @@ import streamlit as st
2
  from streamlit_webrtc import webrtc_streamer, WebRtcMode
3
 
4
 
 
 
 
 
 
5
  @st.cache_resource(experimental_allow_widgets=True)
6
  def init_webcam(width=680):
7
  ctx = webrtc_streamer(
8
  key="FaceIDAppDemo",
9
  mode=WebRtcMode.SENDONLY,
 
10
  media_stream_constraints={
11
  "video": {
12
  "width": {
@@ -17,6 +23,7 @@ def init_webcam(width=680):
17
  },
18
  "audio": False,
19
  },
 
20
  video_receiver_size=1,
21
  async_processing=True,
22
  )
 
2
  from streamlit_webrtc import webrtc_streamer, WebRtcMode
3
 
4
 
5
+ RTC_CONFIGURATION = RTCConfiguration(
6
+ {"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
7
+ )
8
+
9
+
10
  @st.cache_resource(experimental_allow_widgets=True)
11
  def init_webcam(width=680):
12
  ctx = webrtc_streamer(
13
  key="FaceIDAppDemo",
14
  mode=WebRtcMode.SENDONLY,
15
+ rtc_configuration=RTC_CONFIGURATION,
16
  media_stream_constraints={
17
  "video": {
18
  "width": {
 
23
  },
24
  "audio": False,
25
  },
26
+
27
  video_receiver_size=1,
28
  async_processing=True,
29
  )