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.
pip install sphinxcontrib-videoVerified import paths — ran on the pinned version, not inferred.
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.
Ensure `extensions = ['sphinxcontrib.video']` is present and correct in your `conf.py`.
Place local videos in your project's `_static` folder and confirm `html_static_path` is configured. Use relative paths like `_static/my_video.mp4` in the `video` directive.
If default styling is insufficient, add custom CSS to your Sphinx project (e.g., in `_static/custom.css` linked via `html_css_files` in `conf.py`) to target the video and caption HTML elements.
If video alignment is not as expected, try adding `:align: default` to your `video` directive.