# Video Element

## 1. Shape

```ts
interface VideoClip extends BaseClip {
  type: "video";
  src: string | { $ref: string };
  source?: {
    start?: number;
    end?: number;
  };
  volume?: number;
  muted?: boolean;
  playbackRate?: number;
}
```

## 2. Supported fields

### `src`
- Type: `string | { $ref: string }`
- Required: yes
- Purpose: direct video URL or video asset reference

### `source.start`
- Type: `number`
- Required: no
- Unit: seconds
- Purpose: trim start time inside the source media

### `source.end`
- Type: `number`
- Required: no
- Unit: seconds
- Purpose: trim end time inside the source media

### `volume`
- Type: `number`
- Required: no
- Default: `1`

### `muted`
- Type: `boolean`
- Required: no
- Default: `false`

### `playbackRate`
- Type: `number`
- Required: no
- Default: `1`

## 3. Current runtime behavior

- `src` supports direct URLs
- `src` supports `$ref`
- `source.start` works
- `source.end` works
- `muted: true` forces effective volume to `0`
- `source.end` affects the effective playable duration of the clip

## 4. Shared fields that work well with video

You can safely combine `video` with:
- `transform`
- `style`
- `zIndex`
- `animations`
- `keyframes`
- `transition`

Notes:
- `style.borderRadius` works
- `style.objectFit` works with `fill / cover / contain`
- `style.filters` works
- `fill`: stretches to the target box and may distort
- `cover`: preserves aspect ratio and may crop
- `contain`: preserves aspect ratio and may letterbox

## 5. Example

```json
{
  "type": "video",
  "start": 0,
  "duration": 6,
  "src": { "$ref": "hero-video" },
  "source": {
    "start": 2,
    "end": 8
  },
  "muted": true,
  "playbackRate": 1,
  "transform": {
    "x": "50%",
    "y": "50%",
    "width": "100%",
    "height": "100%"
  },
  "style": {
    "objectFit": "cover",
    "filters": [
      { "type": "blur", "value": 32 },
      { "type": "brightness", "value": 0.7 }
    ]
  },
  "transition": {
    "type": "fade",
    "duration": 0.2
  }
}
```