Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -102,10 +102,10 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
102 |
for path in output_paths:
|
103 |
# Create a video player and a download link for each video file
|
104 |
if path.suffix in ['.mp4', '.webm', '.ogg']:
|
105 |
-
video_path = f
|
106 |
-
video_component = f
|
107 |
-
download_link = f
|
108 |
-
html_components.append(f
|
109 |
|
110 |
return html_components, # add more return values as needed
|
111 |
|
@@ -114,6 +114,7 @@ outputs = [
|
|
114 |
# add more outputs as needed
|
115 |
]
|
116 |
|
|
|
117 |
video_file = gr.inputs.File(label="Video File")
|
118 |
quality = gr.inputs.Dropdown(
|
119 |
choices=["18", "23", "27", "28", "32"],
|
|
|
102 |
for path in output_paths:
|
103 |
# Create a video player and a download link for each video file
|
104 |
if path.suffix in ['.mp4', '.webm', '.ogg']:
|
105 |
+
video_path = f"http://localhost:5000/files/{path.name}"
|
106 |
+
video_component = f"<video width='320' height='240' controls><source src='{video_path}' type='video/{path.suffix.lstrip('.')}'>Your browser does not support the video tag.</video>"
|
107 |
+
download_link = f"<p><a href='{video_path}' download>Download this video</a></p>"
|
108 |
+
html_components.append(f"{video_component}{download_link}")
|
109 |
|
110 |
return html_components, # add more return values as needed
|
111 |
|
|
|
114 |
# add more outputs as needed
|
115 |
]
|
116 |
|
117 |
+
|
118 |
video_file = gr.inputs.File(label="Video File")
|
119 |
quality = gr.inputs.Dropdown(
|
120 |
choices=["18", "23", "27", "28", "32"],
|