19 lines
614 B
Python
19 lines
614 B
Python
# views.py
|
|
import streamlit as st
|
|
import os
|
|
|
|
def show_video_thumbnail(video):
|
|
col1, col2, col3 = st.columns([1, 2, 1])
|
|
|
|
with col1:
|
|
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 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
|