Video won't auto play on mobile, only on desktop

Hi there! I have entered a code in custom liquid to auto play the video on my home page which works fine. When it is switched to mobile, it does not not auto play. Is there a code for this? I am using Craft theme.

Hi there! This is Paul from the Weaverse team. :blush:

Autoplaying videos on mobile devices can be tricky due to restrictions imposed by iOS and Android. However, you can try adding the muted and playsinline attributes to your video tag to improve the chances of autoplay working on mobile:

<video autoplay muted playsinline loop>
  <source src="your-video-url.mp4" type="video/mp4">
</video>

Keep in mind that even with these attributes, autoplay might not work consistently across all mobile devices, as some may still block autoplay to save users’ data or battery.

Let me know if you need any more help. Cheers!

Thanks for the response! When I add that code to the video, it makes the area under the video on the mobile version very long and empty.