Update app.py
Browse files
app.py
CHANGED
@@ -785,12 +785,12 @@ def display_videos_and_links():
|
|
785 |
return
|
786 |
|
787 |
video_files_sorted = sorted(video_files, key=lambda x: len(x.split('.')[0]))
|
788 |
-
|
789 |
-
cols = st.columns(
|
790 |
col_index = 0 # Initialize column index
|
791 |
|
792 |
for video_file in video_files_sorted:
|
793 |
-
with cols[col_index %
|
794 |
# Embedding video with autoplay and loop using HTML
|
795 |
#video_html = ("""<video width="100%" loop autoplay> <source src="{video_file}" type="video/mp4">Your browser does not support the video tag.</video>""")
|
796 |
#st.markdown(video_html, unsafe_allow_html=True)
|
|
|
785 |
return
|
786 |
|
787 |
video_files_sorted = sorted(video_files, key=lambda x: len(x.split('.')[0]))
|
788 |
+
num_columns=3
|
789 |
+
cols = st.columns(num_columns) # Define num_columns columns outside the loop
|
790 |
col_index = 0 # Initialize column index
|
791 |
|
792 |
for video_file in video_files_sorted:
|
793 |
+
with cols[col_index % num_columns]: # Use modulo 2 to alternate between the first and second column
|
794 |
# Embedding video with autoplay and loop using HTML
|
795 |
#video_html = ("""<video width="100%" loop autoplay> <source src="{video_file}" type="video/mp4">Your browser does not support the video tag.</video>""")
|
796 |
#st.markdown(video_html, unsafe_allow_html=True)
|