Skip to content

Video and lite embed

Preview Available in release assets

Show authored video behind an explicit activation boundary so third-party embed code makes no request before the visitor chooses to load it.

Video and lite embed primary example

Show code
<figure class="thin-video-embed"
data-video-src="https://media.example/embed/launch-film"
data-video-title="Launch film"
data-video-allow="fullscreen"
data-video-allowfullscreen>
<div data-video-stage>
  <img src="/media/launch-film-poster.webp" alt="" width="1600" height="900" loading="lazy" decoding="async">
  <button type="button" data-video-activate aria-label="Play Launch film">Play video</button>
</div>
<figcaption>
  Launch film, 2 minutes. <a href="https://media.example/watch/launch-film">Watch on the media host</a>.
</figcaption>
<details>
  <summary>Transcript</summary>
  <p>Provide the complete authored transcript here.</p>
</details>
</figure>

Each authored example uses the production assets and includes copyable markup.

Anatomy

  • Figure with poster stage
  • Native activation button
  • Caption and durable fallback link
  • Optional authored transcript

Variants and sizes

  • 16:9 default — shown above
  • Authored ratio via --thin-video-ratio — shown above
  • Captioned — shown above
  • Transcript included — shown above

Rendered fixtures exercise authored content and constrained layouts with the same production assets.

  • Poster — shown above
  • Loading after consent — shown above
  • Ready — shown above
  • Failed with fallback link — shown above
  • Narrow container — shown above

Interaction and keyboard behavior

A native button creates the iframe on click; Enter and Space activation are supplied by the browser. The authored link remains independently usable.

Accessibility

Give the activation button and created iframe a specific accessible name. Provide captions in the chosen player and an adjacent transcript when appropriate; never rely on the poster to convey essential information.

Contract
MEDIA
Basis
Native media or a native link fallback; no custom media role
Evidence
  • tests/unit/behaviors/video-embed.test.ts

API

Use .thin-video-embed with data-video-src and data-video-title. The optional data-video-allow, data-video-sandbox, and data-video-allowfullscreen attributes are copied to the iframe only after activation.

Behavior tier: dependency-free

Custom properties

PropertyDefaultDescription
--thin-video-ratio16 / 9Aspect ratio of the poster and activated iframe stage.

Fallback

Without JavaScript, the poster, description, transcript, and ordinary platform-independent watch link remain available; no iframe or provider request is created.

Assets and dependencies

  • /components.css
  • /behaviors.js

Dependencies: None

Source: packages/ui/src/items/video-embed/style.ts