Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,19 +114,27 @@ 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 |
-
#
|
118 |
with gr.Row():
|
119 |
with gr.Column(scale=1, min_width=400):
|
120 |
selected_video_link = gr.Textbox(label="Selected Video Link", interactive=False)
|
|
|
121 |
play_video_button = gr.Button("Play Video")
|
122 |
|
|
|
|
|
123 |
with gr.Column(scale=1, min_width=400):
|
124 |
search_query_input = gr.Textbox(label="Search YouTube",
|
125 |
placeholder="Enter your search query here",
|
126 |
elem_id="search_query_input")
|
127 |
search_button = gr.Button("Search")
|
|
|
128 |
search_output = gr.Gallery(label="Search Results", columns=1, height="800px", elem_id="search_output")
|
129 |
|
|
|
|
|
|
|
|
|
130 |
# Update the search results and store video IDs
|
131 |
def update_search_results(query):
|
132 |
search_results = youtube_search(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 |
+
# Row for Selected Video Link and Play Video Button
|
118 |
with gr.Row():
|
119 |
with gr.Column(scale=1, min_width=400):
|
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 |
+
# Add a row for the video output (below the search output)
|
135 |
+
with gr.Row():
|
136 |
+
video_output = gr.HTML(label="Video Player")
|
137 |
+
|
138 |
# Update the search results and store video IDs
|
139 |
def update_search_results(query):
|
140 |
search_results = youtube_search(query)
|