Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Define a list of video entries (title and corresponding Google Drive URL)
|
| 4 |
+
video_bank = [
|
| 5 |
+
{"https://drive.google.com/file/d/1SuqZO7bk2K56QdpjnKRpl1V5Xou0bu8N/view"},
|
| 6 |
+
]
|
| 7 |
+
|
| 8 |
+
st.title("Video Bank")
|
| 9 |
+
|
| 10 |
+
# Search functionality
|
| 11 |
+
search_query = st.text_input("Search for a video by title")
|
| 12 |
+
|
| 13 |
+
# Filter videos based on the search query
|
| 14 |
+
filtered_videos = [video for video in video_bank if search_query.lower() in video['title'].lower()]
|
| 15 |
+
|
| 16 |
+
if filtered_videos:
|
| 17 |
+
for video in filtered_videos:
|
| 18 |
+
st.subheader(video["title"])
|
| 19 |
+
# Embed the Google Drive video using an iframe
|
| 20 |
+
st.markdown(f"""
|
| 21 |
+
<iframe src="https://drive.google.com/file/d/{video['url'].split('/')[-2]}/preview"
|
| 22 |
+
width="640" height="480" allow="autoplay"></iframe>
|
| 23 |
+
""", unsafe_allow_html=True)
|
| 24 |
+
|
| 25 |
+
# Provide download link
|
| 26 |
+
st.markdown(f"[Download Video]({video['url']})")
|
| 27 |
+
else:
|
| 28 |
+
st.write("No videos found.")
|