# VideoNode

<!-- schema:start — tự sinh từ video.schema.ts, không sửa tay -->

Video phát từ một đường dẫn, có thể kèm ảnh bìa (light) và tỉ lệ khung.

## Resolved name

`video`

## Configurable props

### Props

| Prop | Giá trị | Responsive | Mô tả |
| --- | --- | --- | --- |
| `src` | `https://… · /…` | không | Đường dẫn video |
| `light` | `https://… · /…` | không | Đường dẫn ảnh bìa hiển thị trước khi phát |

### `sx`

| Key | Giá trị | Breakpoint |
| --- | --- | --- |
| `width` | `px · 'N%' · 'auto'` | mọi breakpoint |
| `marginTop` | `px · 'auto'` | mọi breakpoint |
| `marginRight` | `px · 'auto'` | mọi breakpoint |
| `marginBottom` | `px · 'auto'` | mọi breakpoint |
| `marginLeft` | `px · 'auto'` | mọi breakpoint |
| `paddingTop` | `px` | mọi breakpoint |
| `paddingRight` | `px` | mọi breakpoint |
| `paddingBottom` | `px` | mọi breakpoint |
| `paddingLeft` | `px` | mọi breakpoint |
| `borderStyle` | `'solid' · 'dashed' · 'dotted'` | mọi breakpoint |
| `borderTopWidth` | `px` | mọi breakpoint |
| `borderRightWidth` | `px` | mọi breakpoint |
| `borderBottomWidth` | `px` | mọi breakpoint |
| `borderLeftWidth` | `px` | mọi breakpoint |
| `borderColor` | `color` | mọi breakpoint |
| `borderTopLeftRadius` | `px 0..9999` | mọi breakpoint |
| `borderTopRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomRightRadius` | `px 0..9999` | mọi breakpoint |
| `borderBottomLeftRadius` | `px 0..9999` | mọi breakpoint |
| `aspectRatio` | `'W / H'` | mọi breakpoint |

`color` = `var(--color-{primary\|secondary\|red\|orange\|yellow\|green\|blue\|violet\|neutral}-{100..800\|contrast}) · var(--color-background-{subtle\|default\|emphasis}) · var(--color-border-default) · var(--color-surface-default) · var(--color-common-{black\|white}) · #rgb · #rrggbb`

## Rules

- **Nội dung**: không chứa node con.
- **Cha hợp lệ**: bất kỳ.
- props.src là bắt buộc: react-player không hiển thị gì khi video không có nguồn.

<!-- schema:end -->

## Behavior

Dùng `react-player` bên dưới, nên `src` có thể là YouTube, Vimeo, Twitch, SoundCloud, Streamable, Wistia, Facebook hoặc file video trực tiếp.

## Usage

```tsx
import { VideoNode } from '@janbox/storefront-builder';

// YouTube video
<VideoNode
  src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  sx={{ width: '100%', aspectRatio: '16 / 9' }}
/>

// MP4 video với thumbnail
<VideoNode
  src="https://example.com/video.mp4"
  light="https://example.com/thumbnail.jpg"
  sx={{ width: '100%', aspectRatio: '16 / 9' }}
/>

// Responsive width, aspect ratio cố định
<VideoNode
  src="https://vimeo.com/123456789"
  sx={{
    width: '100%',
    aspectRatio: '16 / 9',
    borderTopLeftRadius: 8,
    borderTopRightRadius: 8,
    borderBottomLeftRadius: 8,
    borderBottomRightRadius: 8,
    md: { width: '80%' },
  }}
/>
```
