CB commited on
Commit
c20c8cb
·
verified ·
1 Parent(s): 4b8a9ae

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +2 -5
streamlit_app.py CHANGED
@@ -451,14 +451,11 @@ if st.sidebar.button("Load Video", use_container_width=True):
451
 
452
  if st.session_state["videos"]:
453
  try:
454
- # defensive: only preview if file exists and non-empty
455
- if os.path.exists(st.session_state["videos"]) and os.path.getsize(st.session_state["videos"]) > 0:
456
- st.sidebar.video(st.session_state["videos"], loop=st.session_state.get("loop_video", False))
457
- else:
458
- st.sidebar.write("Couldn't preview video (file missing or empty)")
459
  except Exception:
460
  st.sidebar.write("Couldn't preview video")
461
 
 
462
  with st.sidebar.expander("Options", expanded=False):
463
  loop_checkbox = st.checkbox("Enable Loop", value=st.session_state.get("loop_video", False))
464
  st.session_state["loop_video"] = loop_checkbox
 
451
 
452
  if st.session_state["videos"]:
453
  try:
454
+ st.sidebar.video(st.session_state["videos"], loop=st.session_state.get("loop_video", False))
 
 
 
 
455
  except Exception:
456
  st.sidebar.write("Couldn't preview video")
457
 
458
+
459
  with st.sidebar.expander("Options", expanded=False):
460
  loop_checkbox = st.checkbox("Enable Loop", value=st.session_state.get("loop_video", False))
461
  st.session_state["loop_video"] = loop_checkbox