infinite scroll
This commit is contained in:
16
app/views.py
16
app/views.py
@@ -1,20 +1,18 @@
|
||||
# views.py
|
||||
import streamlit as st
|
||||
import os
|
||||
|
||||
def show_video_thumbnail(video):
|
||||
col1, col2, col3 = st.columns([1, 2, 1])
|
||||
video_name = video["mp4_file_name"]
|
||||
thumb = video["thumbnail_file"]
|
||||
mp4 = video["mp4_file"]
|
||||
|
||||
with col1:
|
||||
if os.path.exists(thumb):
|
||||
st.image(thumb, width="content")
|
||||
st.caption(video_name)
|
||||
if video.thumbnail_file and os.path.exists(video.thumbnail_file):
|
||||
st.image(video.thumbnail_file, width="content")
|
||||
st.caption(video.mp4_file_name)
|
||||
|
||||
with col2:
|
||||
if os.path.exists(mp4):
|
||||
if st.button(f"▶️ Lire 📅 {video.get('record_datetime', '')} — 🕒 {video.get('day_of_week', '')}", key=f"play_{video_name}"):
|
||||
st.video(mp4)
|
||||
if video.mp4_file and os.path.exists(video.mp4_file):
|
||||
if st.button(f"▶️ Lire 📅 {video.record_datetime or ''} — 🕒 {video.day_of_week or ''} - 📍 {video.address or ''}", key=f"play_{video.id}"):
|
||||
st.video(video.mp4_file)
|
||||
|
||||
return col3
|
||||
|
||||
Reference in New Issue
Block a user