# External video

The external_video object is available through the media attribute of the product object.

The `external_video` object is available through the `media` attribute of the `product` object. It contains information about a Vimeo or YouTube video attached to a product.

> **Note:** The object and the filters [external_video_tag](https://developer.versacommerce.de/articles/liquid-filters-media-filters#externalvideotag) and [external_video_url](https://developer.versacommerce.de/articles/liquid-filters-media-filters#externalvideourl) for YouTube and Vimeo exist in VersaCommerce. `product.media` currently returns no external videos, though.

## external_video.alt

Returns the alt text of the video, set on the product page in the shop admin.

## external_video.aspect_ratio

Returns the aspect ratio of the external video.

## external_video.external_id

Returns the ID of the external video.

```liquid
{% assign external_videos = product.media | where: "media_type", "external_video" %}

{% for external_video in external_videos %}
  {{ external_video.external_id }}
{% endfor %}
```

```text
neFK-pv2sKY
JthaEfEsLYg
```

## external_video.host

Returns the name of the video host (`youtube` or `vimeo`).

## external_video.id

Returns the `media_id` of the external video.

## external_video.media_type

Returns the type of the object (`external_video`). Use it to filter the `media` array of the `product` object.

```liquid
{% assign external_videos = product.media | where: "media_type", "external_video" %}

{% for external_video in external_videos %}
  {{external_video.external_id}}
{% endfor %}
```

```text
neFK-pv2sKY
JthaEfEsLYg
```

## external_video.position

Returns the position of the external video in the `media` array of the `product` object.


## More properties

VersaCommerce also provides these properties on the `external_video` object:

| Properties | Returns |
|---|---|
| `preview_image` | Preview image supplied at construction |
