Update app.py
Browse files
app.py
CHANGED
@@ -122,6 +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), "", None
|
126 |
except Exception as e:
|
127 |
return gr.update(value="", visible=False), f"Invalid YouTube URL: {str(e)}", None
|
@@ -132,6 +133,7 @@ def clear_on_audio_input(audio):
|
|
132 |
|
133 |
if audio is not None:
|
134 |
last_modified =1
|
|
|
135 |
return "", gr.update(value="", visible=False), "", gr.update(interactive=True)
|
136 |
return gr.update(), gr.update(), gr.update(), gr.update(interactive=False)
|
137 |
|
|
|
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 |
+
print ("last_modified 2:",last_modified)
|
126 |
return gr.update(value=embed_html, visible=True), "", None
|
127 |
except Exception as e:
|
128 |
return gr.update(value="", visible=False), f"Invalid YouTube URL: {str(e)}", None
|
|
|
133 |
|
134 |
if audio is not None:
|
135 |
last_modified =1
|
136 |
+
print ("last_modified 1:",last_modified)
|
137 |
return "", gr.update(value="", visible=False), "", gr.update(interactive=True)
|
138 |
return gr.update(), gr.update(), gr.update(), gr.update(interactive=False)
|
139 |
|