Embed a Video

On this page, you’ll learn:

  • How to embed a video in a page.

  • How to embed a YouTube or Vimeo video in a page.

Add a video to a page

You can embed self-hosted videos or videos shared on YouTube and Vimeo.

Video format support is dictated by the user’s browser and/or system. For a list of the web video formats each browser supports, see the Mozilla Developer Supported Media Formats documentation.

Insert animated GIFs with the image macro.
Embedded self-hosted video syntax
video::video-file.mp4[]

Let’s break this down. You start with the video macro prefix, video::. Next is the target. Put the path of the video relative to the video catalog in that slot (no need for an attribute prefix). Finally, end with a pair of square brackets ([]).

Add a YouTube or Vimeo video

To embed a video hosted on YouTube or Vimeo, put the video’s ID in the macro target and the name of the hosting service (youtube, vimeo) between the brackets.

Embedded Youtube video syntax
video::rPQoq7ThGAU[youtube]

Asciidoctor resources