Update app.py
Browse files
app.py
CHANGED
@@ -122,7 +122,7 @@ def embed_youtube(youtube_url):
|
|
122 |
video_id = fetch_youtube_id(youtube_url)
|
123 |
embed_html = f'<iframe width="560" height="315" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
|
124 |
last_modified = 2;
|
125 |
-
return gr.update(value=embed_html, visible=True), "", gr.update(), gr.update(interactive=bool(
|
126 |
except Exception as e:
|
127 |
return gr.update(value="", visible=False), f"Invalid YouTube URL: {str(e)}", gr.update(),gr.update()
|
128 |
return gr.update(value="", visible=False), "", gr.update(), gr.update()
|
|
|
122 |
video_id = fetch_youtube_id(youtube_url)
|
123 |
embed_html = f'<iframe width="560" height="315" src="https://www.youtube.com/embed/{video_id}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
|
124 |
last_modified = 2;
|
125 |
+
return gr.update(value=embed_html, visible=True), "", gr.update(), gr.update(interactive=bool(youtube_url))
|
126 |
except Exception as e:
|
127 |
return gr.update(value="", visible=False), f"Invalid YouTube URL: {str(e)}", gr.update(),gr.update()
|
128 |
return gr.update(value="", visible=False), "", gr.update(), gr.update()
|