--- title: 'Liquid objects: video' description: >- Information about a video uploaded as [product media](/docs/api/liquid/objects/product-media) or a [`file_reference` metafield](/apps/metafields/types). api_name: liquid source_url: html: 'https://shopify.dev/docs/api/liquid/objects/video' md: 'https://shopify.dev/docs/api/liquid/objects/video.md' --- # video Information about a video uploaded as [product media](https://shopify.dev/docs/api/liquid/objects/product-media) or a [`file_reference` metafield](https://shopify.dev/apps/metafields/types). *** **Tip:** Use the \\\video\\_tag\\ filter\ to output the video in an HTML \\<video\>\ tag. *** ## Properties * * **alt** [string](https://shopify.dev/docs/api/liquid/basics#string) * The alt text of the video. * **aspect\_​ratio** [number](https://shopify.dev/docs/api/liquid/basics#number) * The aspect ratio of the video as a decimal. * **duration** [number](https://shopify.dev/docs/api/liquid/basics#number) * The duration of the video in milliseconds. * **id** [number](https://shopify.dev/docs/api/liquid/basics#number) * The ID of the video. * **media\_​type** [string](https://shopify.dev/docs/api/liquid/basics#string) * The media type of the model. Always returns `video`. ExampleFilter for media of a specific type You can use the `media_type` property with the [`where` filter](https://shopify.dev/docs/api/liquid/filters/where) to filter the [`product.media` array](https://shopify.dev/docs/api/liquid/objects/product#product-media) for all media of a desired type. ##### Code ```liquid {% assign videos = product.media | where: 'media_type', 'video' %} {% for video in videos %} {{- video | video_tag }} {% endfor %} ``` ##### Data ```json { "product": { "media": [ { "media_type": "external_video" }, { "media_type": "video" } ] } } ``` ##### Output ```html ``` * **position** [number](https://shopify.dev/docs/api/liquid/basics#number) * The position of the video in the [`product.media`](https://shopify.dev/docs/api/liquid/objects/product#product-media) array. * **preview\_​image** [image](https://shopify.dev/docs/api/liquid/objects/image) * A preview image for the video. * **sources** array of [video\_source](https://shopify.dev/docs/api/liquid/objects/video_source) * The source files for the video. ##### Example ```json { "alt": "Potion beats", "aspect_ratio": 1.779, "duration": 34801, "id": 22070396551233, "media_type": "video", "position": 2, "preview_image": {}, "sources": [] } ```