JaMugen commited on
Commit
b50fcde
·
1 Parent(s): 509f846

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -66,23 +66,15 @@ drive = GoogleDrive(gauth)
66
  # Gradio Interface
67
  def display_videos(text):
68
  videos = display_text(text)
69
- video_tags = ""
70
- for video in videos:
71
- abs_video_path = os.path.abspath(video)
72
- if os.path.exists(abs_video_path):
73
- video_tag = f"<video width='320' height='240' controls><source src='file://{abs_video_path}' type='video/mp4'></video><br>"
74
- print("Generated video tag:", video_tag) # Print generated video tag
75
- video_tags += video_tag
76
- else:
77
- print(f"Video file '{video}' not found.")
78
- return video_tags
79
 
80
  iface = gr.Interface(
81
  fn=display_videos,
82
  inputs="text",
83
- outputs="html",
84
  title="Video Viewer",
85
  description="Enter text to fetch and display videos from Google Drive"
86
  )
87
 
88
  iface.launch()
 
 
66
  # Gradio Interface
67
  def display_videos(text):
68
  videos = display_text(text)
69
+ return gr.video(videos)
 
 
 
 
 
 
 
 
 
70
 
71
  iface = gr.Interface(
72
  fn=display_videos,
73
  inputs="text",
74
+ outputs="video",
75
  title="Video Viewer",
76
  description="Enter text to fetch and display videos from Google Drive"
77
  )
78
 
79
  iface.launch()
80
+