21 lines
585 B
Python
21 lines
585 B
Python
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)
|
|
|
|
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)
|
|
|
|
return col3
|