Video

A YouTube or Vimeo video.

When to use it

A YouTube or Vimeo video in the page.

When not to

Videos from other services (use embed where they are allowed) and videos that play by themselves.

Accessibility

The frame is named by its title, which screen readers announce; write what the video is about. It loads only when it comes into view, so the page stays fast.

See it live

The component library shows this component in the default theme, in every variant: open it in the component library

The video example as the component library shows it in the default theme

Fields

What the component’s dialog asks for. In a Doc, keyed rows start with the key; rows in order follow the order below. One row, its cells in the order of the fields.

Field

Key

Kind

Required

Address

url

Plain text, one line

Yes

Title

title

Plain text, one line

No

Variants

This component has no variants of its own; a theme can add some.

In Google Docs

A component is a table. Its first cell names it; the rows below hold its fields. This is the example table:

video

Watch on YouTube (https://www.youtube.com/watch?v=aqz-KE-bpKQ)

Trip highlights

In a page file

In a site kept as a folder or in Git, the same component is a block of the page’s JSON file:

JSON
{
  "name": "video",
  "rows": [
    [
      {
        "link": "Watch on YouTube",
        "href": "https://www.youtube.com/watch?v=aqz-KE-bpKQ"
      },
      "Trip highlights"
    ]
  ]
}

Markup and classes

What the component writes takes these classes, for a theme’s CSS: the component’s own name, name__part for its parts and name--variant for each variant (the variant’s plain name is there too).

Class

What it marks

video

The component

The HTML the example above writes, as the component library builds it in the default theme:

html
<div class="video"><iframe src="https://www.youtube-nocookie.com/embed/aqz-KE-bpKQ" title="Trip highlights" loading="lazy" allowfullscreen referrerpolicy="strict-origin-when-cross-origin"></iframe></div>

Visitor texts

Texts it shows visitors, in the page’s language. Every one is in the visitor texts reference.

Key

Text

site.video.defaultTitle

Video

Extending it

Its files in SeedPage. A theme or a site changes the markup by giving a file of the same name (the Liquid part), and a new component can extend this one.

  • src/components/video.js
  • src/components/video/video.liquid