Spaces:
Sleeping
Sleeping
Updated WebRTC component
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from streamlit_webrtc import webrtc_streamer, RTCConfiguration
|
2 |
import streamlit as st
|
3 |
import av
|
4 |
import cv2
|
@@ -90,10 +90,9 @@ class VideoProcessor:
|
|
90 |
return av.VideoFrame.from_ndarray(img, format="bgr24")
|
91 |
|
92 |
|
93 |
-
# Streamlit WebRTC component
|
94 |
webrtc_streamer(
|
95 |
key="monitor",
|
96 |
video_processor_factory=VideoProcessor,
|
97 |
-
mode=
|
98 |
-
rtc_configuration=RTCConfiguration(iceServers=[])
|
99 |
-
)
|
|
|
1 |
+
from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
|
2 |
import streamlit as st
|
3 |
import av
|
4 |
import cv2
|
|
|
90 |
return av.VideoFrame.from_ndarray(img, format="bgr24")
|
91 |
|
92 |
|
|
|
93 |
webrtc_streamer(
|
94 |
key="monitor",
|
95 |
video_processor_factory=VideoProcessor,
|
96 |
+
mode=WebRtcMode.RECVONLY, # ✅ FIXED: Use enum, not string
|
97 |
+
rtc_configuration=RTCConfiguration(iceServers=[]) # Disable STUN
|
98 |
+
)
|