Spaces:
Sleeping
Sleeping
| 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.") | |