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 externalvideotag and 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.

externalvideo.aspectratio

Returns the aspect ratio of the external video.

externalvideo.externalid

Returns the ID of the external video.

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

{% for external_video in external_videos %}
  {{ external_video.external_id }}
{% endfor %}
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.

externalvideo.mediatype

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

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

{% for external_video in external_videos %}
  {{external_video.external_id}}
{% endfor %}
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