Why won't my homepage video auto play on laptop but works on mobile?

Hi, hoping someone can help me please. I added a video to my homepage yesterday (auto play). This was working fine on computer and mobile, but today it won’t auto play on laptop, but auto plays on mobile. Any idea how I fix this so it auto plays on both? Below is the code I used. Thank you.

{% if template == “index” or template == “page” %}

{% endif %}>

Hello @NeuroDepth ,

It seems there is an issue with the way you’ve embedded the video in your Shopify store. To ensure consistent autoplay behavior on both laptops and mobile devices, you can try using the HTML5 video tag directly without the iframe.

Here’s an updated version of the code that you can use:

{% if template == "index" or template == "page" %}
  
{% endif %}

Make sure to replace “https://example.com/path/to/video.webm” and “https://example.com/path/to/video.mp4” with the actual URLs of your video files. Ensure that the video files are accessible and properly hosted on your server or a reliable video hosting platform.

Hope this can help.

Ali Reviews team.

Hi @NeuroDepth

I hope you are doing good and welcome to the Shopify Community!
I am San from MS Web Designer.

You can remove the previous code and add this code:

{% if template == “index” or template == “page” %}

{% endif %}>

Regards,

San

This works when I am customising store, but once I click save and view store it doesn’t auto play. Any suggestions?

Hi, thanks for your help. This works when I’m customising my store, but once I click save the video stops auto playing. Any suggestions?

I found an easier solution to this problem via Youtube video, check out this video

1 Like

Just wanted to say this worked PERFECTLY for me. That gentleman has some other excellent tutorials also.

Thanks for the tip!