Spaces:
Build error
Build error
CB commited on
Update streamlit_app.py
Browse files- streamlit_app.py +6 -4
streamlit_app.py
CHANGED
|
@@ -164,16 +164,18 @@ if st.session_state["url"]:
|
|
| 164 |
if st.session_state["videos"]:
|
| 165 |
|
| 166 |
try:
|
| 167 |
-
st.sidebar.video(
|
| 168 |
-
|
|
|
|
|
|
|
| 169 |
except Exception as e:
|
| 170 |
st.write("Couldn't show video")
|
| 171 |
|
| 172 |
with st.sidebar.expander("Options", expanded=False):
|
| 173 |
#Loop button
|
| 174 |
loop_button = st.button("Toggle Loop", key="loop_button")
|
| 175 |
-
|
| 176 |
-
|
| 177 |
|
| 178 |
#Clear button
|
| 179 |
st.button("Clear Video 🔥", on_click=_remove_all_videos, type="secondary", help="Clear all downloaded videos", use_container_width=True,)
|
|
|
|
| 164 |
if st.session_state["videos"]:
|
| 165 |
|
| 166 |
try:
|
| 167 |
+
st.sidebar.video(
|
| 168 |
+
st.session_state["videos"]
|
| 169 |
+
loop = st.session_state.get("loop_video", False)
|
| 170 |
+
)
|
| 171 |
except Exception as e:
|
| 172 |
st.write("Couldn't show video")
|
| 173 |
|
| 174 |
with st.sidebar.expander("Options", expanded=False):
|
| 175 |
#Loop button
|
| 176 |
loop_button = st.button("Toggle Loop", key="loop_button")
|
| 177 |
+
if loop_button:
|
| 178 |
+
st.session_state["loop_video"] = not st.session_state.get("loop_video", False)
|
| 179 |
|
| 180 |
#Clear button
|
| 181 |
st.button("Clear Video 🔥", on_click=_remove_all_videos, type="secondary", help="Clear all downloaded videos", use_container_width=True,)
|