<!-- source-hash: 9e88b910bdaffc13eb668740a6d415f4 -->
Renders video content from YouTube URLs, bare video IDs, or file sources (HLS/MP4) with smart auto-detection and three layout modes. Consolidates the previous `<VideoPlayer>` and `<YouTubeEmbed>` primitives into a single component.

## Key Components

- **`Video`** — Primary export. Discriminates on `kind` prop (`'youtube'` | `'file'` | `'auto'`) to route to the correct player branch, then wraps in the chosen layout
- **`extractYouTubeId`** — Exported utility that parses any YouTube URL shape or bare 11-char video ID into a raw video ID. Uses strict URL parsing + anchored regex (ReDoS-safe)
- **`VideoProps`** — Discriminated union type (`VideoFileProps | VideoYouTubeProps | VideoAutoProps`)
- **`VideoLayout`** — `'centered'` | `'fill'` | `'native'`
- **`resolveKind`** (internal) — URL classifier that maps a URL to `'youtube'` or `'file'`
- **`YouTubeFacade`** (internal) — Lite-YouTube poster + click-to-iframe embed
- **`FilePlayer`** (internal) — `<MuxPlayer>` wrapper handling HLS, MP4, captions, and Mux Data

## Usage Example

```typescript
// Auto-detect source from URL (recommended)
<Video url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" layout="centered" />

// Bare YouTube ID
<Video url="dQw4w9WgXcQ" layout="native" priority />

// HLS or MP4 file with captions
<Video
  kind="file"
  url="https://cdn.example.com/video.m3u8"
  captionsUrl="https://cdn.example.com/captions.vtt"
  layout="fill"
  muted
/>

// Marketing embed — minimal YouTube controls
<Video
  kind="youtube"
  url="https://youtu.be/dQw4w9WgXcQ"
  layout="centered"
  minimalControls
  title="Product demo"
/>

// Validate a URL without rendering
import { extractYouTubeId } from './video';
const id = extractYouTubeId('https://youtu.be/dQw4w9WgXcQ'); // → "dQw4w9WgXcQ"
```