Shopify Image

Steps to Embed YouTube, Vimeo Videos

  • From your Shopify admin, go to "Products".

  • Click a product to see its details page.

  • Click Add media and then click on "Embed video".

  • Add a video url of the product hosted on YouTube or Vimeo.

Shopify Image Shopify Image

Steps to Embed Other Platform Videos

We can also upload the videos which are from other platform like Wistia, or mp4 videos. For that we need to follow the below steps.

Step 1

We need to upload an image and give the alt description for the image.

Shopify Image

Step 2

Based on this alt description we can modify the liquid code and add the video. For that, go to the product-template.liquid file which is present in "Sections" folder.

Edit the code after the line {% for image in product.images %}

Add the below code to display the video on the product gallery of the product page

{% for image in product.images %}
{% if image.alt contains 'vid' %}
Add video code here
{% else %}
{% assign featured_image = image.src %}
<img id="ProductPhotoImg" class="product_variant_image" data-image-id="{{ image.id }}" alt="{{ featured_image.alt | escape }}" src="{{ featured_image | img_url: '1024x1024' }}" width="1024" height="1024">
{% endif %}
{% endfor %}

Shopify Image

Result

By following all the above steps, we can display on the product's gallery.

Shopify Image
Read similar blog: How to Prepare Your Shopify Site for Google Page Experience Updates and Why it is Important ➞

Receive latest marketing insights, data and inspiration

View Blogs ➞ Subscribe ➞

Start your Project Today