A store owner wants their Featured Product section to autoplay a video instead of displaying a clickable thumbnail that redirects to another page.
Solution Process:
Initial attempts involved adding JavaScript code to featured-product.liquid and theme.liquid files, but these didn’t work initially
The working solution required a script that triggers video autoplay, inserted before the </body> tag in theme.liquid
Additional CSS was needed to enable autoplay on mobile devices
Complications & Fixes:
After implementation, images on other featured products stopped displaying
This was resolved by updating CSS selectors to target only the specific video block using its unique ID (#MediaGallery-template--16261819760883__69229733-8e33-4a8f-91bb-b71a4e728a87)
The final fix involved modifying .featured-product .product__modal-opener to .featured-product .product__modal-opener.product__modal-opener--video
Outcome:
The solution successfully works on both desktop and mobile. Code snippets are available on GitHub for reference. Other users confirmed the script works on Dawn theme v10.0.0.
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
On my Featured Product it displays a thumbnail of the video instead of auto playing the video of the product. When you click on the thumbnail it takes you to another page to click on the video to play. Is there a way that instead of a thumbnail the video just plays instead?
I removed the code from the first try. Unfortunately the 2nd attempt hasn’t worked either but I’ve kept the code in for you to see. Thanks for your help
all code for only this block. And you need note “#MediaGallery-template–16261819760883__69229733-8e33-4a8f-91bb-b71a4e728a87” that is an ID of block. If you remove this block after add it again you need check this ID after update again.