Spaces:
Sleeping
Sleeping
Add 3 files
Browse files- README.md +8 -9
- app.py +20 -0
- requirements.txt +3 -0
README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
title: Video Display
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
---
|
| 10 |
-
|
| 11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
title: Video Display
|
| 4 |
+
sdk: gradio
|
| 5 |
+
sdk_version: 3.39.0
|
| 6 |
+
app_file: app.py
|
| 7 |
+
emoji: 👀
|
| 8 |
+
colorFrom: green
|
| 9 |
+
colorTo: blue
|
| 10 |
+
---
|
|
|
|
|
|
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This code is in the same repo as the web page
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from gradio.inputs import URL
|
| 4 |
+
from gradio.outputs import HTML
|
| 5 |
+
|
| 6 |
+
def display_video(url):
|
| 7 |
+
return f"""
|
| 8 |
+
<video width="420" height="315" controls>
|
| 9 |
+
<source src="{url}" type="video/mp4">
|
| 10 |
+
</video>
|
| 11 |
+
{url}
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
demo = gr.Interface(
|
| 15 |
+
display_video,
|
| 16 |
+
["url"],
|
| 17 |
+
HTML(type="youtube"),
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
numpy
|
| 2 |
+
gradio==3.39.0
|
| 3 |
+
matplotlib
|