GenDey commited on
Commit
687c7d2
·
verified ·
1 Parent(s): 7a89f31

Updated WebRTC component

Browse files
Files changed (1) hide show
  1. app.py +4 -5
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="recvonly", # This avoids two-way ICE negotiation
98
- rtc_configuration=RTCConfiguration(iceServers=[]), # Remove STUN to prevent UDP signaling
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
+ )