# YouTubeEmbed

> A YouTube player sized to its container: a 16:9 `<iframe>` served from YouTube's privacy-enhanced host, so a visitor receives no YouTube cookies until they press play, and lazy-loaded so a video below the fold costs nothing until it scrolls into view.

```ts
import { YouTubeEmbed } from "@sdxc/ui";
```

Renders the player filling its container's inline axis at 16:9. The frame always sends
the embedding page's origin as referrer, without which YouTube refuses to play.

## Examples

```tsx
<YouTubeEmbed videoId="dQw4w9WgXcQ" title={t("video.title")} />
```

```tsx
<YouTubeEmbed videoId="dQw4w9WgXcQ" start={90} title={t("video.title")} />
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `videoId` | `string` | The eleven-character id from the video's `watch?v=` or `youtu.be/` URL. |
| `start?` | `number` | Seconds into the video the player starts at; zero or less starts at the beginning. |
| `title` | `string` | The frame's accessible name, announced before a reader enters the player. |

Also accepts everything in `Omit<
		TagProps<"iframe">,
		"src" | "title" | "allow" | "referrerpolicy" | "referrerPolicy"
	>`.

