Embed a hosted video in Docusaurus with MDX
Updated: November 29, 2026
A Docusaurus guide needs a video, and your published versions show different interfaces. Use an iframe on a page that processes MDX, which combines Markdown with React components. Keep the clip associated with each release and check both routes after building the site.
Match each file to its release
Say the Export button moves between versions 1 and 2. Upload the approved recording of each interface to Dembed and note which release it shows. Once the clips are ready, open Embed for each one and copy the HTTPS /embed/ address from src. Save the /v/ watch link as well.
Write the iframe in JSX
Place the iframe in your MDX page next to the step it demonstrates. In the example, replace v_EJEMPLO with your clip ID and set the title to describe the video. JSX takes a style object inside braces. Use allowFullScreen for fullscreen and loading="lazy" to defer loading until the frame is near the viewport.
Keep the clip name next to its release in your editorial notes. If your project provides a deployment preview, test both routes there before publishing. A working version selector can still lead to a page that embeds the wrong video. Before retiring an old release, check whether the clip is also embedded on a page that remains published.
<iframe
src="https://dembed.cc/embed/v_EJEMPLO"
title="Export data"
loading="lazy"
allowFullScreen
style={{ width: "100%", aspectRatio: "16 / 9", border: 0 }}
/>Check the current and older docs
Build the docs using your project’s usual workflow. Open the current page and an older release through the version selector. Check that each plays the right file and has a title that describes that interface. If readers also view the raw Markdown, add a /v/ link they can follow.
Frequently asked questions
Projects using Docusaurus versioning store separate copies for releases. Change only the pages whose readers should see the new clip.