Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to display video in a gr.HTML() component #10122

Closed
1 task done
HamoonJafarianTR opened this issue Dec 4, 2024 · 2 comments
Closed
1 task done

Unable to display video in a gr.HTML() component #10122

HamoonJafarianTR opened this issue Dec 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@HamoonJafarianTR
Copy link

Describe the bug

I want to display a video in gr.HTML(). It works with Gradio==4.44.0, But as soon as I upgrade to the newest version it stops working and the video is not shown.
When I downgrade to 4.44.0 version, it works, so the code and paths and permissions are correct. I also tried static folder and set_static_paths solutions, but it doesn't work. I want to show a video in HTML component because it allows me to display the video at a specific start and end time which is unavailable in gr.Video() as far as I know.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr  
html = """    
        <div class='myVideo'>    
            <video controls>    
                <source src='file/shots/output.MP4' type='video/mp4'>    
                Your browser does not support the video tag.    
            </video>    
        </div>    
"""  
with gr.Blocks() as demo:  
    with gr.Row():  
        gr.HTML(html)  
demo.launch(allowed_paths=["/Users/a612/Desktop/Hj/"])  

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.44.0
gradio_client version: 1.3.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.4.0
fastapi: 0.115.5
ffmpy: 0.4.0
gradio-client==1.3.0 is not installed.
httpx: 0.27.0
huggingface-hub: 0.25.1
importlib-resources: 6.4.5
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.0
numpy: 1.26.4
orjson: 3.10.7
packaging: 24.0
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.7.3
pydub: 0.25.1
python-multipart: 0.0.12
pyyaml: 6.0.2
ruff: 0.6.8
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.5
typing-extensions: 4.11.0
urllib3: 2.2.3
uvicorn: 0.31.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.9.0
httpx: 0.27.0
huggingface-hub: 0.25.1
packaging: 24.0
typing-extensions: 4.11.0
websockets: 12.0

Severity

I can work around it

@HamoonJafarianTR HamoonJafarianTR added the bug Something isn't working label Dec 4, 2024
@abidlabs
Copy link
Member

abidlabs commented Dec 4, 2024

Please use src='/gradio_api/file/shots/output.MP4'

@abidlabs abidlabs closed this as completed Dec 4, 2024
@abidlabs
Copy link
Member

abidlabs commented Dec 4, 2024

see #9463

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants