Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ def display_video(video_file):
|
|
5 |
if video_file is None:
|
6 |
return None, "No video uploaded."
|
7 |
|
8 |
-
# Check if the uploaded file is valid
|
9 |
try:
|
10 |
-
if
|
11 |
return video_file, None
|
12 |
else:
|
13 |
return None, "Uploaded file is empty."
|
@@ -16,7 +16,7 @@ def display_video(video_file):
|
|
16 |
|
17 |
with gr.Blocks() as demo:
|
18 |
with gr.Column():
|
19 |
-
video_file = gr.File(label="Upload Video File", type="
|
20 |
output_video = gr.Video()
|
21 |
output_message = gr.Textbox(label="Output Message")
|
22 |
submit_button = gr.Button("Display Video")
|
|
|
5 |
if video_file is None:
|
6 |
return None, "No video uploaded."
|
7 |
|
8 |
+
# Check if the uploaded file is a valid binary file
|
9 |
try:
|
10 |
+
if len(video_file) > 0: # Simple check to confirm it contains content
|
11 |
return video_file, None
|
12 |
else:
|
13 |
return None, "Uploaded file is empty."
|
|
|
16 |
|
17 |
with gr.Blocks() as demo:
|
18 |
with gr.Column():
|
19 |
+
video_file = gr.File(label="Upload Video File", type="binary", file_types=["mp4", "avi", "mov"])
|
20 |
output_video = gr.Video()
|
21 |
output_message = gr.Textbox(label="Output Message")
|
22 |
submit_button = gr.Button("Display Video")
|