# Videos

> Embed YouTube, Vimeo, Loom, and Wistia videos, or play video files from your repository.

Use `<Video>` with the link to a video. Paste the address you'd share: Typemark turns it into the player.

<Video src="https://www.youtube.com/watch?v=aqz-KE-bpKQ" title="Big Buck Bunny" />

```mdx
<Video src="https://www.youtube.com/watch?v=aqz-KE-bpKQ" title="Big Buck Bunny" />
```

Players fill the width of the page at 16:9 and load only when the reader scrolls to them.

## Supported players

| Service | Links you can use |
|---------|-------------------|
| YouTube | `youtube.com/watch?v=…`, `youtu.be/…`, `youtube.com/shorts/…`, `youtube.com/embed/…` |
| Vimeo | `vimeo.com/…`, `player.vimeo.com/video/…` |
| Loom | `loom.com/share/…`, `loom.com/embed/…` |
| Wistia | `fast.wistia.net/embed/iframe/…`, `<account>.wistia.com/medias/…` |

YouTube videos play from `youtube-nocookie.com`, YouTube's privacy-enhanced mode. A start time in the link (`?t=90` or `?t=1m30s`) is kept.

A link to any other site isn't embedded: readers see a link to it instead.

## Video files

Point `src` at a video in your repository, or at a video file on the web. MP4, WebM, MOV, and M4V files play with the browser's controls.

```mdx
<Video src="/videos/setup.mp4" />
```

Add `autoPlay` for a short clip that plays silently on a loop, like a GIF:

```mdx
<Video src="/videos/drag-and-drop.mp4" autoPlay />
```

Paths like `/videos/setup.mp4` work the same way as [image paths](https://docs.typemark.dev/components/frames#image-paths).

## Captions

`caption` adds a frame with a caption below the video.

```mdx
<Video src="https://vimeo.com/76979871" caption="The Typemark editor in two minutes" />
```

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `src` | string | required | A YouTube, Vimeo, Loom, or Wistia link, or a video file. |
| `title` | string | the service's name | Describes the player for screen readers. |
| `caption` | string | none | Text below the video, in a frame. |
| `autoPlay` | boolean | `false` | For video files: play muted, on a loop, without controls. |

## HTML embeds

Pages imported from other docs platforms often embed videos with `<iframe>` and `<video>` tags, inside a [Frame](https://docs.typemark.dev/components/frames). Those work as they are:

```mdx
<Frame>
  <iframe
    src="https://www.youtube.com/embed/aqz-KE-bpKQ"
    title="YouTube video player"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
    allowFullScreen
  ></iframe>
</Frame>

<video autoPlay muted loop playsInline src="/videos/demo.mp4"></video>
```

For security, an `<iframe>` only embeds the players listed above, sandboxed, with Typemark's own settings in place of the attributes on the tag. An `<iframe>` pointing anywhere else becomes a link to that page.

## In the visual editor

Type `/video`, paste the link, and press `Enter`. The block plays the video in the editor; **Change link** swaps it. Press `Escape` in an empty block to remove it. `<iframe>` and `<video>` tags show as source and are saved exactly as written.
