Shopify themes, liquid, logos, and UX
hey i want my video to autoplay in the slideshow of the prodcut page like this shopify website did it https://fragrancemilking.ca/products/jpg-le-beau-le-parfum?_pos=1&_psq=le+bea&_ss=e&_v=1.0
i have dawn theme, but i dont know if they added code or they did something else thanks in advance
This is Richard from PageFly - Shopify Page Builder App
Hi @perfumecartel Please add code here to fix it:
Step 1: Online Stores > Themes > Edit code
Step 2: Choose file theme.liquid
Step 3: Add code above the tag </body>
<script>
document.addEventListener("DOMContentLoaded", function() {
setTimeout(() => {
const videos = document.querySelectorAll('.product video');
videos.forEach(video => {
video.muted = true;
});
setTimeout(() => {
videos.forEach(video => {
video.play();
});
}, 1000);
}, 1000);
});
</script>
Hope my solution will help you resolve the issue.
Best regards,
Richard | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
➜ Optimize your Shopify store with PageFly Page Builder (Free plan available)
All features are available from Free plan. Live Chat Support is available 24/7.
You can add autoplay="autoplay" attribute on your video tag
To make your video autoplay, add the autoplay="autoplay" attribute to the video tag in the main-product.liquid file. This will require some coding.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025