@quiver99
How about this?
import streamlit as st
from streamlit_webrtc import webrtc_streamer, VideoHTMLAttributes
muted = st.checkbox("Mute")
webrtc_streamer(
key="mute_sample",
video_html_attrs=VideoHTMLAttributes(
autoPlay=True, controls=True, style={"width": "100%"}, muted=muted
),
)
You can configure the <video>
element’s attribute via the video_html_attrs
argument,
and the muted
attribute switches mute/unmute on the client-side.
Note that other attributes such as autoPlay
and style
are specified too in the example above.
This default set of the video attribute values is used when nothing is provided for the video_html_attrs
argument,
but if you override it, you have to explicitly provide these necessary attributes.