You are viewing the v1.0.0 documentation.

Video

Embed videos from local files, YouTube, or Vimeo

The Video component embeds videos from local files or popular platforms like YouTube and Vimeo.

Usage

YouTube Video

Code
mdx
1<Video
2 src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
3 caption="Example video"
4/>

Local Video

Code
mdx
1<Video
2 src="/videos/demo.mp4"
3 caption="Product demo"
4 controls
5 poster="/videos/poster.jpg"
6/>

Live Examples

YouTube Embed

YouTube video embed example

Props

PropTypeDefaultDescription
srcstringrequiredVideo URL (YouTube, Vimeo, or local path)
captionstring-Caption below the video
autoplaybooleanfalseAuto-play video on load
loopbooleanfalseLoop video playback
mutedbooleanfalseMute video audio
controlsbooleantrueShow video controls
posterstring-Poster image URL (local videos only)

Supported Platforms

YouTube

Supports various YouTube URL formats:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID

Vimeo

Supports Vimeo URLs:

  • https://vimeo.com/VIDEO_ID

Local Files

Supports standard video formats:

  • MP4 (.mp4)
  • WebM (.webm)
  • Ogg (.ogg)

Tips

Warning

Autoplay is often blocked by browsers unless the video is also muted. For auto-playing videos, use both autoplay and muted:

Code
mdx
1<Video src="/videos/animation.mp4" autoPlay muted loop>
Tip
Use the `poster` prop for local videos to show a preview image before the video loads.