---
title: 'Liquid filters: video_tag'
description: Generates an HTML `
\If the \m3u8\ source isn\'t supported, then the player falls back to the \mp4\ source.
***
##### Code
```liquid
{% for media in product.media %}
{% if media.media_type == 'video' %}
{{ media | video_tag }}
{% endif %}
{% endfor %}
```
##### Data
```json
{
"product": {
"media": [
{
"media_type": "external_video"
},
{
"media_type": "video"
}
]
}
}
```
##### Output
```html
```
## Rendered output
### image\_size
```oobleck
media | video_tag: image_size: string
```
Specify the dimensions of the video's poster image in pixels.
##### Code
```liquid
{% for media in product.media %}
{% if media.media_type == 'video' %}
{{ media | video_tag: image_size: '400x' }}
{% endif %}
{% endfor %}
```
##### Data
```json
{
"product": {
"media": [
{
"media_type": "external_video"
},
{
"media_type": "video"
}
]
}
}
```
##### Output
```html
```
## Rendered output
### Optional supported HTML5 attributes
```oobleck
media | video_tag: attribute: boolean
```
`video_tag` supports all [HTML5 video attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attributes). For example:
| Attribute | Value |
| - | - |
| `autoplay` | Whether to automatically play the video after it’s loaded. Accepted values:`true`,`false` |
| `loop` | Whether to loop the video. Accepted values:`true`,`false` |
| `muted` | Whether to mute the video’s audio. Accepted values:`true`,`false` |
| `controls` | Whether a user can control the video playback. Accepted values:`true`,`false` |
##### Code
```liquid
{% for media in product.media %}
{% if media.media_type == 'video' %}
{{ media | video_tag: autoplay: true, loop: true, muted: true, controls: true }}
{% endif %}
{% endfor %}
```
##### Data
```json
{
"product": {
"media": [
{
"media_type": "external_video"
},
{
"media_type": "video"
}
]
}
}
```
##### Output
```html
```
## Rendered output