How to set up automatic video play on a product page?

Topic summary

A user seeks help enabling autoplay for videos on their product pages.

Initial Solution Provided:

  • Add JavaScript code to the theme.liquid file before the closing </body> tag
  • The code detects product pages and triggers autoplay by simulating a click on the poster button

Implementation Issues & Refinements:

  • First attempt failed due to the code not being initially provided (only instructions were shared)
  • Second attempt included corrected code with proper syntax
  • User successfully implemented autoplay but requested removal of video controls (play/stop buttons)
  • Additional code snippet provided to hide video controls by setting controls to false

Current Status:

  • Solution works on desktop devices
  • A new participant reports the autoplay feature doesn’t function on mobile devices
  • Mobile compatibility remains an open question without resolution
Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

Hello,

I would like to make the video that is displayed on my product page play automatically when the page is opened.

Could someone help me set that up?

The url is - https://98cb73-4.myshopify.com/products/test

Password - skeodo

Hello, I have read your problem, and here is the solution, please follow these steps:
Step 1: Open edit code in online store:

Step 2: Find and open the theme.liquid file

Step 3: Scroll to the bottom of the file and add this code before the closing tag

Step 4: Save changes and test your off-page activity

**Hope it helps @DEksperti **

Hello!

Thank you for the reply.

I pasted the code into the theme.liquid but the video still isn’t autoplaying. Have I done it right?

Sorry I didn’t send you the code before. There are currently spelling errors in your code. I would like to send you a new code. Please follow the steps I instructed before and replace it with this code:

Is there any way I can make the dashboard of the video (stop/play button etc.) not show?

You can add this code after the code you added:

It worked for me but it only works on desktop. Is it possible to let it also work on mobile?

1 Like