Spaces:
Running
Running
Enhance video streaming configuration in app.py
Browse files- Added VideoHTMLAttributes to webrtc_streamer for improved video playback options.
- Configured video attributes to enable autoplay and control settings, allowing for better user experience.
app.py
CHANGED
@@ -3,7 +3,7 @@ import cv2
|
|
3 |
import numpy as np
|
4 |
import streamlit as st
|
5 |
import os
|
6 |
-
from streamlit_webrtc import webrtc_streamer, WebRtcMode
|
7 |
from opencv_utils import OpenCVUtils
|
8 |
from twilio.rest import Client
|
9 |
|
@@ -155,4 +155,10 @@ webrtc_streamer(
|
|
155 |
video_frame_callback=video_frame_callback,
|
156 |
media_stream_constraints={"video": True, "audio": False},
|
157 |
async_processing=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
)
|
|
|
3 |
import numpy as np
|
4 |
import streamlit as st
|
5 |
import os
|
6 |
+
from streamlit_webrtc import webrtc_streamer, WebRtcMode, VideoHTMLAttributes
|
7 |
from opencv_utils import OpenCVUtils
|
8 |
from twilio.rest import Client
|
9 |
|
|
|
155 |
video_frame_callback=video_frame_callback,
|
156 |
media_stream_constraints={"video": True, "audio": False},
|
157 |
async_processing=True,
|
158 |
+
video_html_attrs=VideoHTMLAttributes(
|
159 |
+
autoPlay=True,
|
160 |
+
controls=False,
|
161 |
+
# aqui usamos os sliders w e h para ajustar a janela
|
162 |
+
style={"width": f"{w}px", "height": f"{h}px"},
|
163 |
+
),
|
164 |
)
|