Embed hosted video in Sphinx documentation

Updated: November 30, 2026

You maintain a Sphinx guide that ships as a website and a PDF. In a reStructuredText page, use the raw directive with the html format for the player. Put the watch link outside that directive so the PDF can include it too.

Prepare the demo and both addresses

Imagine a calibration guide with a 55-second clip on setting a zero point in an interface. Upload a recording cleared for sharing to Dembed. When it is ready, copy the HTTPS /embed/ address from Embed and save the public /v/ watch link. The first goes in the src attribute and the second in the text link.

Add an HTML block and a separate link

In the .rst file, write the raw directive for html. Leave a blank line and indent the iframe line. After another blank line, write the watch link without indenting it. Replace v_EJEMPLO in both example addresses, then adapt the title and link text. The link is available on the web page too.

If you distribute printed copies, keep a short written description of the action. When the recording changes, review both addresses in the source file. The PDF and website may be released on different schedules. If you share the PDF with someone, check that the link works outside the network where you built it. Open the exported file in a PDF viewer and follow the link in a private browser session.

.. raw:: html

   <iframe src="https://dembed.cc/embed/v_EJEMPLO" title="Watch how to set the zero point" loading="lazy" allowfullscreen style="width:100%;aspect-ratio:16/9;border:0"></iframe>

`Watch how to set the zero point <https://dembed.cc/v/v_EJEMPLO>`_

Check both outputs

Generate the HTML and PDF using your project’s normal workflow. On the web page, test the player and a narrow view. In the PDF, check that the link text is visible and opens the right clip. If your project restricts the raw directive, publish the watch link and the written instruction.

Frequently asked questions

The raw block targets the html format. Keep the watch link outside the block for the PDF and check the resulting file.

You might also like

Host your videos for free and earn from every view

Create your account in under a minute, upload your first video and start earning from day one.