Video

Embed a self-hosted MP4 or WebM file with native browser playback controls.

Use <Video> to embed a self-hosted or generic video file in your documentation. The component renders a native HTML5 <video> element with a single <source> child. Pass a publicly accessible URL to an MP4, WebM, or other supported format.

For YouTube or Vimeo, use <YouTube> or <Vimeo> instead.

mdx
<Video src="https://cdn.example.com/demo.mp4" type="video/mp4" />

Video sources

Pass a full https URL to a file you host (on your own CDN, object storage, or any public address the reader's browser can fetch). Unlike <Image>, <Video> does not resolve repo-relative paths from /docs; the src value is used as-is on the <source> element.

Hosting options

ApproachHow
CDN or object storageUpload the file and use the public URL in src
Raw GitHub URLLink to the raw file URL from your repository
External hostAny https address the reader's browser can fetch
mdx
<Video src="https://cdn.example.com/guides/install.mp4" type="video/mp4" />

Example

The sample below uses a public demo file. Replace src with your own hosted video URL in production docs.

mdx
<Video
  src="https://cdn.example.com/demo.mp4"
  type="video/mp4"
/>

MIME type

Set type to the video MIME type when you know it, for example video/mp4 or video/webm. This helps the browser select the correct source. When omitted, the browser infers the format from the URL or file extension where possible.

mdx
<Video src="https://cdn.example.com/clip.webm" type="video/webm" />

Properties

srcstringrequired

The video file URL passed to the <source> element. Must be a full http or https address that readers can load in the browser.

When src is omitted or empty, the component renders nothing.

mdx
<Video src="https://cdn.example.com/walkthrough.mp4" type="video/mp4" />

typestringoptional

Optional MIME type for the video source, for example video/mp4, video/webm, or video/ogg.

mdx
<Video src="https://cdn.example.com/clip.mp4" type="video/mp4" />

Behavior

ConditionResult
src setRenders an HTML5 <video> with one <source> child and playback controls
src omitted or emptyRenders nothing
type setPassed to the <source> element's type attribute
type omitted<source> has no type attribute; browser infers format where possible

The component applies default layout styles: full width, 16:9 aspect ratio, and rounded corners. Native playback controls are always enabled. It does not accept muted, autoPlay, loop, or other native <video> attributes; only src and type are implemented.

See also

  • YouTube: embed YouTube videos by ID
  • Vimeo: embed Vimeo videos by ID
  • Image: images with repo-relative paths and zoom
  • Components overview: when to use media embeds and other components