CB commited on
Commit
88b1689
·
verified ·
1 Parent(s): 48dfca2

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +8 -2
streamlit_app.py CHANGED
@@ -87,7 +87,6 @@ analysis_prompt = expander.text_area("Enter analysis", "watch entire video and d
87
  #Password
88
  expander.text_input("Video Password", key="video-password", placeholder="Enter Video Password")
89
 
90
-
91
  @st.cache_resource
92
  def initialize_agent():
93
  return Agent(
@@ -165,11 +164,18 @@ if st.session_state["url"]:
165
  if st.session_state["videos"]:
166
 
167
  try:
168
- st.sidebar.video(st.session_state["videos"], loop=True)
 
169
  except Exception as e:
170
  st.write("Couldn't show video")
171
 
172
  with st.sidebar.expander("Options", expanded=False):
 
 
 
 
 
 
173
  st.button("Clear Video 🔥", on_click=_remove_all_videos, type="secondary", help="Clear all downloaded videos", use_container_width=True,)
174
 
175
  try:
 
87
  #Password
88
  expander.text_input("Video Password", key="video-password", placeholder="Enter Video Password")
89
 
 
90
  @st.cache_resource
91
  def initialize_agent():
92
  return Agent(
 
164
  if st.session_state["videos"]:
165
 
166
  try:
167
+ st.sidebar.video(st.session_state["videos"])
168
+ loop = st.session_state.get("loop_video", False))
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
+ if loop_button:
176
+ st.session_state["loop_video"] = not st.session_state.get("loop_video", False)
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,)
180
 
181
  try: