eaglelandsonce commited on
Commit
85d6203
1 Parent(s): bd439bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -230,19 +230,21 @@ bot_inputs = [
230
  chatbot_component
231
  ]
232
 
233
-
234
-
235
- youtube_url = "https://www.youtube.com/shorts/_q_bfR2Iz4c"
236
 
237
  def display_video():
238
- # Convert the YouTube URL to an embeddable format
239
- embed_url = youtube_url.replace("watch?v=", "embed/")
240
- # Embed the YouTube video in an HTML format
241
- video_embed = f'<iframe width="560" height="315" src="{embed_url}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
242
  return video_embed
243
 
244
-
245
-
 
 
 
 
 
246
 
247
 
248
  with gr.Blocks() as demo:
@@ -299,11 +301,7 @@ with gr.Blocks() as demo:
299
  gr.HTML(TITLE)
300
 
301
  with gr.Tab("Final Product"):
302
- gr.Interface(
303
- fn=display_video,
304
- inputs=gr.inputs.Textbox(visible=False), # Invisible dummy input
305
- outputs="html",
306
- title="Hardcoded YouTube Video",
307
- description="This interface displays a hardcoded YouTube video."
308
- )
309
  demo.queue(max_size=99).launch(debug=False, show_error=True)
 
230
  chatbot_component
231
  ]
232
 
233
+ # Hardcoded YouTube URL
234
+ youtube_url = "https://www.youtube.com/embed/_q_bfR2Iz4c"
 
235
 
236
  def display_video():
237
+ # Embed the YouTube video in an HTML iframe
238
+ video_embed = f'<iframe width="560" height="315" src="{youtube_url}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
 
 
239
  return video_embed
240
 
241
+ # Create a Gradio interface
242
+ interface = gr.Interface(
243
+ fn=display_video,
244
+ outputs="html",
245
+ title="YouTube Video Player",
246
+ description="This interface displays a hardcoded YouTube video."
247
+ )
248
 
249
 
250
  with gr.Blocks() as demo:
 
301
  gr.HTML(TITLE)
302
 
303
  with gr.Tab("Final Product"):
304
+ interface.launch()
305
+
306
+
 
 
 
 
307
  demo.queue(max_size=99).launch(debug=False, show_error=True)