Video embed
On this page
On this page
Overview
A Video embed is a graphical preview of a video overlayed with a play button. When clicked, the embedded YouTube video will begin playing.
Edit element properties
import '@rhds/elements/rh-video-embed/rh-video-embed.js';
<rh-video-embed>
<img slot="thumbnail" src="video-thumb.jpg" alt="Image description">
<template>
<iframe title="Title of video" width="900" height="499" src="https://www.youtube.com/embed/Hc8emNr2igU" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
</template>
<p slot="caption"><a class="rh-video-embed-caption-link" href="https://www.redhat.com/">View the infographic</a></p>
</rh-video-embed>
import { VideoEmbed } from "@rhds/elements/react/rh-video-embed/rh-video-embed.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<VideoEmbed>
<img slot="thumbnail" src="video-thumb.jpg" alt="Image description" />
<template />
<p slot="caption">
<a className="rh-video-embed-caption-link" href="https://www.redhat.com/">View the infographic</a>
</p>
</VideoEmbed>
);
Add to rh-video-embed when a video requires consent for cookies
Boolean flag to flip with JavaScript when cookie consent has been granted or revoked. See the Require Consent demo for reference.
Status
What do these mean?
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Planned
When to use
- When you need to embed a YouTube video on a page
- When you want a faster YouTube embed
- When you don’t want to load several megabytes of JavaScript for a YouTube embed
Red Hat Logo on a gray background
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component will be added to RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.