6 Embedding video files
This page demonstrates how to embed video into a Quarto webpage. This is a native capability of Quarto, and requires no extensions to be installed.
6.1 Embedding a video
To embed a video, use the {{< video >}}
shortcode. You can embed local files or URLs of online videos:
{{< video local-video-file.mp4 >}}
{{< video URL_TO_VIDEO >}}
6.1.1 Local file
Tip
This template provides an assets/videos
folder, which can be used for adding video files to the repository.
{{< video assets/videos/template-tutorial-video-1a.mp4 >}}
6.1.2 Remote video file
{{< video https://youtu.be/dQw4w9WgXcQ?si=_BZIcKuz9U91pGqB >}}
6.1.3 Cross-referencing videos
To use cross-references with videos, wrap the video in a div
using three colons, as in the example below. They can then be referenced using the usual @fig-label
method.
And itβs cross-referenced like this (Figure 6.1).
::: {#fig-example-1}
{{< video assets/videos/template-tutorial-video-1a.mp4 >}}
This is an example video with cross-referencing (and a legend!)
:::
And it's cross-referenced like this (@fig-example-1).