AI-ANK commited on
Commit
87fc5eb
1 Parent(s): fc21828

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -25,17 +25,19 @@ ACTOR_VIDEOS = {
25
  },
26
  }
27
 
28
- import gradio as gr
29
-
30
- def test_html(inp):
31
- return f"You selected: {inp}"
32
 
 
33
  iface = gr.Interface(
34
- fn=test_html,
35
- inputs=gr.HTML(html='<button onclick="Gradio.inputs[0].value = \'Hello\'; Gradio.submit();">Click me</button>'),
36
- outputs="text",
37
- live=True
 
 
38
  )
39
 
40
- iface.launch()
41
-
 
25
  },
26
  }
27
 
28
+ # Function to change video based on actor selection
29
+ def change_video(actor_name):
30
+ video_url = ACTOR_VIDEOS[actor_name]["video_url"]
31
+ return f'<video width="100%" controls autoplay><source src="{video_url}" type="video/mp4"></video>'
32
 
33
+ # Create Gradio Interface
34
  iface = gr.Interface(
35
+ fn=change_video,
36
+ inputs=gr.Radio(choices=list(ACTOR_VIDEOS.keys()), label="Choose Your Actor"),
37
+ outputs=gr.HTML(label="Your Video"),
38
+ live=True,
39
+ title="Black Mirror Meets The Office: Michael Scott Is Awful",
40
+ description="Choose an actor below and watch them step into the shoes of Michael Scott"
41
  )
42
 
43
+ iface.launch()