Can't enable autoplay on a product.media video

I can’t for the life of me get autoplay to work on a product.media video that we uploaded. Any help would be great. Here is the code we have so far.

{%- for media in product.media -%} 
   

      {% case media.media_type %}
         {% when 'video' %}
         {{ media | video_tag: controls: true, height: "600px"}}
      {% endcase %}
   

{%- endfor -%}

Hi msawyer9616. Hope you are doing well!

Try this code:

{{ media | video_tag: controls: true, autoplay: true, height: "600px"}}

I also recommend adding “muted: true” so that autoplay works correctly on all devices, since IOS devices and some others prohibit autoplay video with sound.

Hope this helps.
Alex

1 Like

Thanks, that worked!

I tried using this, but also the video doesn’t autoplay on mobile

Where do you put this code?

Hi Alex,

Any idea how to solve this to have autoplay on product page https://www.porronet.es/products/sandalia-tacon-medio-de-piel-taupe-nicole?_pos=2&_psq=nicole&_ss=e&_v=1.0

I used your liquid script but insert a new video. I only need to autoplay the current video.

Thanks