JaMugen commited on
Commit
b3e3369
·
1 Parent(s): 15a8186

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -66,13 +66,12 @@ 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
@@ -80,10 +79,11 @@ def display_videos(text):
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()
89
 
 
 
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_tags.append(gradio.Video(abs_video_path))
74
+ print("Generated video tag:", video_tags[-1]) # Print generated video tag
 
75
  else:
76
  print(f"Video file '{video}' not found.")
77
  return video_tags
 
79
  iface = gr.Interface(
80
  fn=display_videos,
81
  inputs="text",
82
+ outputs="video",
83
  title="Video Viewer",
84
  description="Enter text to fetch and display videos from Google Drive"
85
  )
86
 
87
  iface.launch()
88
 
89
+