File size: 1,711 Bytes
2a78406
afe6e94
6f49924
2a78406
a6ed2eb
6f49924
73d0886
6f49924
ca2d73f
4308d91
9c5bf65
d5170df
9c5bf65
 
 
2a78406
 
 
 
 
 
4a1dfbf
2a78406
 
9c5bf65
 
d5170df
2a78406
 
 
 
9c5bf65
2a78406
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import gradio as gr
from IPython.display import HTML, IFrame 
from IPython.display import YouTubeVideo

def display_vid(video):
  #https://www.youtube.com/watch?v=smUHQndcmOY&t=425s
  html = HTML("<iframe width='560' height='315' src='https://www.youtube.com/watch?v=smUHQndcmOY&t=425s' frameborder='0' allowfullscreen></iframe>")
  vid = YouTubeVideo('smUHQndcmOY&t=425s')
  return html
  
def fun(url):
  return gr.Video(value=url)



demo = gr.Blocks()

with demo:
  gr.Markdown("<h1><center>Ask a Question to a YouTube Video and get the timestamp where the probable answer is</center></h1>")
  gr.Markdown(
        "<div>How many times have you seen a long video/podcast on Youtube and wondered only if there would have been 'explanatory' timestamps it would have been so much better..</div>"
        "<div>Well, using this Space/App you can provide a YouTube video link and then provide some questions that you would like, and the App will generate timestamps/play video at those timestamps for you in the space provided. Idea is that your question could be like 'Is this xxxx thing covered in the video?', or maybe 'does the host talks about the architecture of the model', or maybe 'Does host talk about alien doorway on Mars?' and so on.</div><br> <br> <div> This App is Work in Progress, please bear with me.</div>"
    )
  with gr.Row():
    input_url = gr.Textbox() #gr.HTML(placeholder="Enter a video link here..")
    #input_vid = gr.Video()
    output_vid = gr.Video()
  
  b1 = gr.Button("Publish Video")
  #b2 = gr.Button("Generate Image")

  b1.click(fun, input_url, output_vid)
  #b2.click(poem_to_image, poem_txt, output_image)
  #examples=examples

demo.launch(enable_queue=True, debug=True)