video
Information about a video uploaded as product media or a metafield.
Properties
The media type of the model. Always returns
video
.ExampleFilter for media of a specific typeYou can use the
property with the
where
filter to filter theproduct.media
array for all media of a desired type.{% assign videos = product.media | where: 'media_type', 'video' %}{% for video in videos %}{{- video | video_tag }}{% endfor %}{% assign videos = product.media | where: 'media_type', 'video' %} {% for video in videos %} {{- video | video_tag }} {% endfor %}
{ "product": { "media": [ { "media_type": "external_video" }, { "media_type": "video" } ] } }
Output
<video playsinline="playsinline" preload="metadata" aria-label="Potion beats" poster="//polinas-potent-potions.myshopify.com/cdn/shop/products/4edc28a708b7405093a927cebe794f1a.thumbnail.0000000_small.jpg?v=1655255324"><source src="//polinas-potent-potions.myshopify.com/cdn/shop/videos/c/vp/4edc28a708b7405093a927cebe794f1a/4edc28a708b7405093a927cebe794f1a.HD-1080p-7.2Mbps.mp4?v=0" type="video/mp4"><img src="//polinas-potent-potions.myshopify.com/cdn/shop/products/4edc28a708b7405093a927cebe794f1a.thumbnail.0000000_small.jpg?v=1655255324"></video>The position of the video in the
product.media
array.- sourcesarray of video_source
The source files for the video.
Anchor to
{
"alt": "Potion beats",
"aspect_ratio": 1.779,
"duration": 34801,
"id": 22070396551233,
"media_type": "video",
"position": 2,
"preview_image": {},
"sources": []
}
{
"alt": "Potion beats",
"aspect_ratio": 1.779,
"duration": 34801,
"id": 22070396551233,
"media_type": "video",
"position": 2,
"preview_image": {},
"sources": []
}
Was this section helpful?