Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,26 +114,18 @@ with gr.Blocks(css="""
|
|
114 |
gr.Markdown("## YouTube Video Search, Selection, and Playback")
|
115 |
video_ids_state = gr.State() # To store video IDs corresponding to the search results
|
116 |
|
117 |
-
# Row for Selected Video Link and Play Video Button
|
118 |
with gr.Row():
|
119 |
-
with gr.Column(scale=
|
120 |
-
selected_video_link = gr.Textbox(label="Selected Video Link", interactive=False)
|
121 |
-
with gr.Column(scale=1, min_width=400):
|
122 |
-
play_video_button = gr.Button("Play Video")
|
123 |
-
|
124 |
-
# Row for Search Bar and Search Button
|
125 |
-
with gr.Row():
|
126 |
-
with gr.Column(scale=1, min_width=400):
|
127 |
search_query_input = gr.Textbox(label="Search YouTube",
|
128 |
placeholder="Enter your search query here",
|
129 |
-
elem_id="search_query_input")
|
130 |
search_button = gr.Button("Search")
|
131 |
-
with gr.Column(scale=1, min_width=400):
|
132 |
search_output = gr.Gallery(label="Search Results", columns=1, height="800px", elem_id="search_output")
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
|
|
137 |
|
138 |
# Update the search results and store video IDs
|
139 |
def update_search_results(query):
|
|
|
114 |
gr.Markdown("## YouTube Video Search, Selection, and Playback")
|
115 |
video_ids_state = gr.State() # To store video IDs corresponding to the search results
|
116 |
|
|
|
117 |
with gr.Row():
|
118 |
+
with gr.Column(scale=3):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
search_query_input = gr.Textbox(label="Search YouTube",
|
120 |
placeholder="Enter your search query here",
|
121 |
+
elem_id="search_query_input") # Add elem_id to target in CSS
|
122 |
search_button = gr.Button("Search")
|
|
|
123 |
search_output = gr.Gallery(label="Search Results", columns=1, height="800px", elem_id="search_output")
|
124 |
|
125 |
+
with gr.Column(scale=2):
|
126 |
+
selected_video_link = gr.Textbox(label="Selected Video Link", interactive=False)
|
127 |
+
play_video_button = gr.Button("Play Video")
|
128 |
+
video_output = gr.HTML(label="Video Player")
|
129 |
|
130 |
# Update the search results and store video IDs
|
131 |
def update_search_results(query):
|