File size: 631 Bytes
9fab982
07e5e14
9fab982
 
 
 
 
 
 
 
07e5e14
9fab982
 
 
ee1cf10
9fab982
 
 
07e5e14
9fab982
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()