File size: 947 Bytes
4823b51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import streamlit as st

# Define a list of video entries (title and corresponding Google Drive URL)
video_bank = [
    {"https://drive.google.com/file/d/1SuqZO7bk2K56QdpjnKRpl1V5Xou0bu8N/view"},
]

st.title("Video Bank")

# Search functionality
search_query = st.text_input("Search for a video by title")

# Filter videos based on the search query
filtered_videos = [video for video in video_bank if search_query.lower() in video['title'].lower()]

if filtered_videos:
    for video in filtered_videos:
        st.subheader(video["title"])
        # Embed the Google Drive video using an iframe
        st.markdown(f"""
        <iframe src="https://drive.google.com/file/d/{video['url'].split('/')[-2]}/preview" 
        width="640" height="480" allow="autoplay"></iframe>
        """, unsafe_allow_html=True)
        
        # Provide download link
        st.markdown(f"[Download Video]({video['url']})")
else:
    st.write("No videos found.")