sphinx-contrib / video

A sphinx plugin that enables embedding of HTML5 videos
https://sphinxcontrib-video.readthedocs.io
Apache License 2.0
43 stars 29 forks source link

Local videos not getting copied as images #33

Closed krishvk closed 3 months ago

krishvk commented 11 months ago

It looks like the Videos are supposed to be placed only in _static/ directory. I had to learn this hard as images will be copied automatically and linked accordingly. It would be nice if the videos are also auto-managed as images.

I have a nested hierarchy and local images and videos, I am forced to give relative path for videos, while the images work just fine.

.. figure:: image.gif

.. video:: ../../_static/movie.mp4
Calinou commented 11 months ago

I believe this is a Sphinx limitation – images are only included in a top-level _images folder as they're referenced by a .. image:: or .. figure:: directive. This means that even if you rename your video's file extension, it won't work as it's not referenced by any image directive.

I'm not sure how this could be worked around from the extension side.

krishvk commented 11 months ago

When we include figure/images, we refer it locally, when build I see the image is getting copied to _images folder and linked accordingly. This is just not happening for videos.

As I have pointed out, image reference is working but video reference is not

From: Hugo Locurcio @.> Sent: Tuesday, July 25, 2023 10:37 PM To: sphinx-contrib/video @.> Cc: Krishna @.>; Author @.> Subject: Re: [sphinx-contrib/video] Local videos not getting copied as images (Issue #33)

I believe this is a Sphinx limitation – images are only included in a top-level _images folder as they're referenced by a .. image:: directive.

I'm not sure how this could be worked around from the extension side.

— Reply to this email directly, view it on GitHub https://github.com/sphinx-contrib/video/issues/33#issuecomment-1650215548 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYXY2XYKDSW2A5D4OLI4FDXR74J5ANCNFSM6AAAAAA2UT5W6E . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ABYXY2XTC4IHR3Z3YCTJN4TXR74J5A5CNFSM6AAAAAA2UT5W6GWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTCLRFHY.gif Message ID: @. @.> >

jdillard commented 9 months ago

You can use reference from the top level, such as:

.. video:: /_static/movie.mp4
krishvk commented 9 months ago

True, but that feels more like a workaround and not a fix. Since image work but videos do not.