Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| def display_video(video_file): | |
| """ | |
| Displays the uploaded video using Gradio Video component. | |
| Args: | |
| video_file (gradio.File): The uploaded video file object. | |
| """ | |
| if video_file: | |
| return video_file.name # Return the video filename for display | |
| # Create Gradio interface with UploadButton and Video components | |
| interface = gr.Interface( | |
| fn=display_video, | |
| inputs=gr.load(name="Upload Video", file_types=["video"]), | |
| outputs=gr.Video(label="Uploaded Video"), | |
| title="Video Uploader", | |
| description="Upload a video file to display it here." | |
| ) | |
| # Launch the Gradio interface | |
| interface.launch() |