Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,16 @@ user_input = st.text_input("Enter some text:")
|
|
18 |
if st.button("Confirm"):
|
19 |
st.write(f"You entered: {user_input}")
|
20 |
|
21 |
-
# WebRTC
|
22 |
rtc_configuration = {
|
23 |
-
"iceServers": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
|
26 |
# Original Webcam Stream
|
@@ -28,7 +35,7 @@ st.subheader("Original Video Stream")
|
|
28 |
webrtc_streamer(
|
29 |
key="original",
|
30 |
media_stream_constraints={"video": True, "audio": False},
|
31 |
-
rtc_configuration=rtc_configuration, #
|
32 |
)
|
33 |
|
34 |
# Rotated Webcam Stream
|
@@ -37,5 +44,5 @@ webrtc_streamer(
|
|
37 |
key="rotated",
|
38 |
video_transformer_factory=RotatedVideoTransformer,
|
39 |
media_stream_constraints={"video": True, "audio": False},
|
40 |
-
rtc_configuration=rtc_configuration, #
|
41 |
)
|
|
|
18 |
if st.button("Confirm"):
|
19 |
st.write(f"You entered: {user_input}")
|
20 |
|
21 |
+
# WebRTC Configuration with STUN + TURN Server
|
22 |
rtc_configuration = {
|
23 |
+
"iceServers": [
|
24 |
+
{"urls": ["stun:stun.l.google.com:19302"]}, # Free STUN Server
|
25 |
+
{
|
26 |
+
"urls": ["turn:relay1.expressturn.com:3478"], # Free TURN Server
|
27 |
+
"username": "efXy76nVqozh1",
|
28 |
+
"credential": "wD8H1jmVxTFQ"
|
29 |
+
}
|
30 |
+
]
|
31 |
}
|
32 |
|
33 |
# Original Webcam Stream
|
|
|
35 |
webrtc_streamer(
|
36 |
key="original",
|
37 |
media_stream_constraints={"video": True, "audio": False},
|
38 |
+
rtc_configuration=rtc_configuration, # Use STUN + TURN
|
39 |
)
|
40 |
|
41 |
# Rotated Webcam Stream
|
|
|
44 |
key="rotated",
|
45 |
video_transformer_factory=RotatedVideoTransformer,
|
46 |
media_stream_constraints={"video": True, "audio": False},
|
47 |
+
rtc_configuration=rtc_configuration, # Use STUN + TURN
|
48 |
)
|