ysharma HF staff commited on
Commit
e6d9153
1 Parent(s): 14406c9
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -98,9 +98,9 @@ def display_vid(url, question, sample_question=None, example_video=None):
98
  ans_timestamp, ans_timestamp_secondbest = get_answers_timestamp(question, final_transcript, transcript)
99
 
100
  #created embedding width='560' height='315'
101
- html_out = "<iframe width='720' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
102
  print(f"html output is : {html_out}")
103
- html_out_secondbest = "<iframe width='720' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp_secondbest) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
104
 
105
  if question == '':
106
  print(f"Inside display_vid(), Sample_Question coming from Radio box is BEFORE : {sample_question}")
@@ -133,12 +133,12 @@ with demo:
133
  """
134
  )
135
  with gr.Row():
136
- input_url = gr.Textbox(label="Input a Youtube video link") #gr.HTML(placeholder="Enter a video link here..")
137
  input_ques = gr.Textbox(label="Ask a Question")
138
 
139
  with gr.Row():
140
- output_vid = gr.HTML(label="Video will play at the answer timestamp")
141
- output_vid_secondbest = gr.HTML(label="Video will play at the answer timestamp")
142
 
143
  with gr.Row():
144
  example_question = gr.Dropdown(
 
98
  ans_timestamp, ans_timestamp_secondbest = get_answers_timestamp(question, final_transcript, transcript)
99
 
100
  #created embedding width='560' height='315'
101
+ html_out = "<iframe width='730' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
102
  print(f"html output is : {html_out}")
103
+ html_out_secondbest = "<iframe width='730' height='400' src='https://www.youtube.com/embed/" + video_id + "?start=" + str(ans_timestamp_secondbest) + "' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>"
104
 
105
  if question == '':
106
  print(f"Inside display_vid(), Sample_Question coming from Radio box is BEFORE : {sample_question}")
 
133
  """
134
  )
135
  with gr.Row():
136
+ input_url = gr.Textbox(label="Input a Youtube video link")
137
  input_ques = gr.Textbox(label="Ask a Question")
138
 
139
  with gr.Row():
140
+ output_vid = gr.HTML(label="Video from timestamp 1", show_label=True)
141
+ output_vid_secondbest = gr.HTML(label="Video from timestamp 2", show_label=True)
142
 
143
  with gr.Row():
144
  example_question = gr.Dropdown(