Spaces:
Sleeping
Sleeping
Raj Jayendrakumar Muchhala
commited on
Commit
Β·
e74c2c9
1
Parent(s):
96430b4
support for audio video playback
Browse files
app.py
CHANGED
|
@@ -52,6 +52,25 @@ with col_transcript:
|
|
| 52 |
st.subheader("π Paste Your Transcript")
|
| 53 |
transcript = st.text_area("Enter the transcript here:", height=400)
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# Right Column: Clip Plan Generation and Extraction
|
| 56 |
with col_output:
|
| 57 |
st.subheader("π Generated Clip Plans")
|
|
|
|
| 52 |
st.subheader("π Paste Your Transcript")
|
| 53 |
transcript = st.text_area("Enter the transcript here:", height=400)
|
| 54 |
|
| 55 |
+
st.markdown("---")
|
| 56 |
+
st.subheader("π₯ Video/Audio Upload & Playback")
|
| 57 |
+
|
| 58 |
+
# Allow users to choose between file upload or external link
|
| 59 |
+
media_source = st.radio("Select media source", options=["Upload File", "YouTube/External Link"], index=0)
|
| 60 |
+
|
| 61 |
+
if media_source == "Upload File":
|
| 62 |
+
media_file = st.file_uploader("Upload a video or audio file", type=["mp4", "mov", "avi", "mp3", "wav", "ogg"])
|
| 63 |
+
if media_file is not None:
|
| 64 |
+
# Detect media type and play accordingly
|
| 65 |
+
if media_file.type.startswith("video"):
|
| 66 |
+
st.video(media_file)
|
| 67 |
+
elif media_file.type.startswith("audio"):
|
| 68 |
+
st.audio(media_file)
|
| 69 |
+
else:
|
| 70 |
+
media_link = st.text_input("Enter YouTube or external media link:")
|
| 71 |
+
if media_link:
|
| 72 |
+
st.video(media_link)
|
| 73 |
+
|
| 74 |
# Right Column: Clip Plan Generation and Extraction
|
| 75 |
with col_output:
|
| 76 |
st.subheader("π Generated Clip Plans")
|