> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/using-elements/components/content-and-media/video.md).

# Video

The Video component displays one YouTube, Vimeo, or MP4 video. It supports autoplay rules, start time, looping, player controls, a custom thumbnail, responsive framing, and an optional lightbox.

{% embed url="<https://youtu.be/avzBCXIJFU0>" %}

### Supported Content and File Types

* YouTube
* Vimeo
* MP4

Add a YouTube or Vimeo URL to Resources by dragging it from your browser. Add a local MP4 from Finder or import a remote URL.

{% hint style="success" %}
To use a video as a section background, choose Video in a [Container](/elements-docs/using-elements/components/layout-components/container.md) background. [Watch the background video tutorial](https://youtu.be/x59UfuZvMwM).
{% endhint %}

### How to Use Video

You’ll find Video under **Media** in the Components list.

1. Add the video to Resources.
2. Drag **Video** onto the page.
3. Select the video under **Video → Resource**.
4. Choose autoplay, sound, controls, looping, and start time.
5. Configure the thumbnail, aspect ratio, and optional lightbox.
6. Preview playback in a browser.

The Video component also has a drop zone for a custom play button, text, or graphic.

### Component Settings

#### Video

**Autoplay**

* **Immediately** — Attempts to play when the page loads.
* **When in Viewport** — Plays when the video enters the viewport.
* **Never** — Waits for the visitor. This is the default.

**Muted** is enabled by default. Most browsers require muted audio for autoplay.

**Controls** shows or hides native player controls. **Loop** restarts the video when it finishes. These controls apply where supported by the selected video type.

**Time (seconds)** sets the playback start point and defaults to 0.

<figure><img src="/files/IehzQ2trEVKfkZRPdFk9" alt="Video Inspector controls for resource, autoplay, sound, controls, loop, and start time"><figcaption><p>The Video group controls the source and playback behaviour.</p></figcaption></figure>

#### Lightbox

**Enable** opens the video in an overlay and is off by default.

When enabled, **Color** defaults to Black, **Opacity** to 50%, and **Blur** to 0 pixels.

<figure><img src="/files/E25zTFVtT3Br2tgWH5Km" alt="Video Lightbox controls for backdrop colour, opacity, and blur"><figcaption><p>Lightbox backdrop controls.</p></figcaption></figure>

#### Thumbnail

**Type** can be Resource, Custom, or CMS. Resource is the default.

**Mode** switches between Light and Dark thumbnail sources. Custom uses a URL or path; CMS uses a field expression defaulting to `{{item.image.src}}`.

As with the [Image](/elements-docs/using-elements/components/content-and-media/image.md) component, the CMS field must be a Twig expression that outputs the image's URL, like the default `{{item.image.src}}` — a front matter key on its own won't work.

Custom and CMS thumbnails provide **Alt** text.

**Overlay Color** defaults to Surface 50 and **Opacity** to 50%.

{% hint style="info" %}
YouTube resources automatically provide a default thumbnail. Add your own when you need consistent branding or a different crop.
{% endhint %}

<figure><img src="/files/4ZGVvAWWdU0siMgRxg9f" alt="Video Thumbnail controls for source, mode, image, alt text, and overlay"><figcaption><p>Thumbnail settings control the image shown before playback.</p></figcaption></figure>

#### Aspect Ratio

**Aspect Ratio** offers Auto, Wide 16:9, Tall 4:5, or Custom. Auto is the default; Custom defaults to `7/5`.

For a fixed ratio, **Object Fit** offers Fill, Contain, Cover, None, or Scale Down and defaults to Cover. **Position** sets the thumbnail focal point and defaults to Centre.

The aspect ratio controls the thumbnail frame rather than changing the source video’s dimensions.

<figure><img src="/files/npNU2WTOZ9IkOI1Z8iSv" alt="Video thumbnail Aspect Ratio controls with object fit and position options"><figcaption><p>Aspect Ratio controls the thumbnail frame and crop.</p></figcaption></figure>

<figure><img src="/files/KvHBHGBDDCm10aiAjI9B" alt="Video thumbnail Inspector showing custom aspect-ratio settings"><figcaption><p>A custom thumbnail ratio can use any valid x/y value.</p></figcaption></figure>

### Accessibility

Provide captions or a transcript for spoken content. Avoid unexpected audio, retain usable player controls, and describe custom thumbnails when they convey information.

### Tips and Best Practices

* **Mute autoplay:** It is required by most browsers and avoids surprising visitors.
* **Use an intentional thumbnail:** A compressed JPG usually offers good quality and performance.
* **Avoid autoplay for essential content:** Give visitors direct control over important videos.

### Related Components

* [Image](/elements-docs/using-elements/components/content-and-media/image.md) — Shares thumbnail source and aspect-ratio controls.
* [Gallery](/elements-docs/using-elements/components/content-and-media/gallery.md) — Combines several videos and images in one lightbox.
* [Container](/elements-docs/using-elements/components/layout-components/container.md) — Supports background video.

| Common Control                                                                                                     | Description                                                             |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [Link](/elements-docs/using-elements/components/common-controls/link.md)                                           | Link to a page, resource, anchor, email address, or website.            |
| [Layout](/elements-docs/using-elements/components/common-controls/layout.md)                                       | Control positioning, stacking, visibility, overflow, and isolation.     |
| [Sizing](/elements-docs/using-elements/components/common-controls/sizing.md)                                       | Set width, height, and responsive size constraints.                     |
| [Spacing](/elements-docs/using-elements/components/common-controls/spacing.md)                                     | Add responsive margin and padding.                                      |
| [Typography & Text Styles](/elements-docs/using-elements/components/common-controls/typography-and-text-styles.md) | Control fonts, text spacing, decoration, colour, and semantic wrappers. |
| [Backgrounds](/elements-docs/using-elements/components/common-controls/backgrounds.md)                             | Apply colour, image, gradient, SVG, video, and hover backgrounds.       |
| [Transitions](/elements-docs/using-elements/components/common-controls/transitions.md)                             | Choose what animates and set its timing curve, duration, and delay.     |
| [Effects](/elements-docs/using-elements/components/common-controls/effects.md)                                     | Apply shadows, opacity, and hover effects.                              |
| [Filters](/elements-docs/using-elements/components/common-controls/filters.md)                                     | Apply blur, brightness, saturation, shadow, and backdrop effects.       |
| [Transforms](/elements-docs/using-elements/components/common-controls/transforms.md)                               | Scale, rotate, move, and skew components.                               |
| [Borders](/elements-docs/using-elements/components/common-controls/borders.md)                                     | Set border style, colour, opacity, width, radius, and hover states.     |
| [Advanced](/elements-docs/using-elements/components/common-controls/advanced.md)                                   | Add CSS classes and IDs, or change supported HTML tags.                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmacsoftware.com/elements-docs/using-elements/components/content-and-media/video.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
