## class: `WyPreviewMedia`, `wy-preview-media`

Media preview component for audio/video files.

Renders a <video> or <audio> element with fallbacks and loading UI.

**Used sub components:**

*   [`<wy-progress-circular>`](./ui/wy-progress-circular)
*   [`<wy-preview-icon>`](./wy-preview-icon)

### Fields

| Name        | Type                  | Default | Description                                                   | Inherited From |
| ----------- | --------------------- | ------- | ------------------------------------------------------------- | -------------- |
| `format`    | `string`              | `""`    | Preview format to render. Accepts \`"video"\` or \`"audio"\`. |                |
| `src`       | `string`              |         | Source URL used by the media element.                         |                |
| `play`      | `boolean`             | `false` | Toggles playback when the preview item is marked as current.  |                |
| `name`      | `string`              | `""`    | Display name of the media file.                               |                |
| `mediaType` | `string \| undefined` |         | MIME type associated with the media source.                   |                |

### Events

| Name                  | Type                         | Description                            | Inherited From |
| --------------------- | ---------------------------- | -------------------------------------- | -------------- |
| `file-preview-loaded` | `FilePreviewLoadedEventType` | The file preview is considered loaded. |                |

### Attributes

| Name        | Field     | Inherited From |
| ----------- | --------- | -------------- |
| `format`    | format    |                |
| `src`       | src       |                |
| `play`      | play      |                |
| `name`      | name      |                |
| `mediaType` | mediaType |                |

### CSS Parts

| Name                  | Description                                 |
| --------------------- | ------------------------------------------- |
| `wy-content-video`    | Video element container / element.          |
| `wy-content-audio`    | Audio element container / element.          |
| `wy-content-progress` | Progress indicator shown while media loads. |

<hr/>

## Exports

| Kind                        | Name               | Declaration    | Module                             | Package |
| --------------------------- | ------------------ | -------------- | ---------------------------------- | ------- |
| `js`                        | `WyPreviewMedia`   | WyPreviewMedia | lib/components/wy-preview-media.ts |         |
| `custom-element-definition` | `wy-preview-media` | WyPreviewMedia | lib/components/wy-preview-media.ts |         |
