Sphinxcontrib Video

0.4.2 · active · verified Wed Apr 15

sphinxcontrib-video is a Sphinx extension that allows developers and technical writers to embed HTML5 videos (MP4, WebM, Ogg) directly into their Sphinx-generated documentation. It acts as a wrapper around the HTML5 `<video>` tag, exposing most of its parameters as directive options. The library is actively maintained, with the current stable version being 0.4.2, released on January 14, 2026, and typically follows a periodic release cadence.

Warnings

Install

Imports

Quickstart

To quickly use `sphinxcontrib-video`, first ensure it's installed. Then, add `'sphinxcontrib.video'` to the `extensions` list in your `conf.py`. If you plan to host local videos, configure `html_static_path` to point to your `_static` directory. Finally, use the `.. video::` reStructuredText directive in your documentation files, providing the video path and any desired HTML5 video attributes as options.

# In conf.py
import os

project = 'My Video Project'
copyright = '2026, Your Name'
extensions = [
    'sphinxcontrib.video',
]
html_static_path = ['_static'] # Required if using local videos in a '_static' folder

# In an .rst file (e.g., index.rst)
..
  _static/my_intro_video.mp4 is expected to exist
  in your Sphinx project's _static directory.

My Documentation with Video
===========================

This is an example of embedding a local HTML5 video:

.. video:: _static/my_intro_video.mp4
   :width: 60%
   :autoplay:
   :loop:
   :controls:
   :alt: An introductory video showing key features.
   :caption: A short demonstration of the project setup.

Here's an example of embedding an external video:

.. video:: https://example.com/path/to/external_video.mp4
   :poster: https://example.com/path/to/poster_image.jpg
   :width: 500
   :height: 300
   :nocontrols:

view raw JSON →