Displaying video

Topic summary

A user is experiencing an issue where a video added to a product page is not displaying on the live site.

Technical Details:

  • The implementation uses Liquid template code to detect videos embedded in product images
  • Videos are identified by checking if image alt text contains ‘youtube’ or ‘vimeo’
  • The code extracts the video source URL from the alt attribute and attempts to display it

Code Issues:

  • The provided code snippet appears corrupted or reversed in several sections
  • Text fragments like “pleh ruoy rof uoy knahT” (reversed text) and malformed Liquid syntax suggest encoding or copy-paste errors
  • Variable assignments and conditional statements are incomplete or improperly formatted

Current Status:

  • No solutions or responses have been provided yet
  • The issue remains unresolved and requires debugging of the template code
  • Proper code formatting and syntax correction will likely be necessary to identify the root cause
Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

Hello Experts,

We have added a video on the product but it is not displaying on the live page. How can the issue be fixed

{% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %}

  

    {% for image in product.images %}
      - {% if image.alt contains 'youtube' or image.alt contains 'vimeo' %}
            {% assign src=image.alt | split: 'src="' %}
            {% assign src=src[1] | split: '"' | first %}

            {% if src contains '?' %}
              {% assign src=src | append: '&autoplay=1' %}
            {% else %}
              {% assign src=src | append: '?autoplay=1' %}
            {% endif %}

          

            

              
                  {{ image.alt }}
              
            

          

            {% if forloop.length == 1 and settings.thumbnail_position == "no-thumbnails" %}
            
            {% endif %}
          {% else %}
          
            

              
            

          
          {% endif %}
      
    {% endfor %}
  

Thank you for your help