AutoPlay on Sense theme product page slider

AutoPlay on Sense theme product page slider

Jey07
Visitor
3 0 0

Hi! I have the Sense theme on Shopify, and I'm trying to enable autoplay for the product page slider. I managed to get it working on desktop without any issues, but on mobile, the video doesn’t load immediately.

 

In fact, when you swipe right on desktop, the video starts playing, whereas on mobile, there’s a play button that needs to be pressed.

 

It seems that the video isn’t loaded on mobile until the button is pressed. I’ve looked through the Liquid code, but I can’t find where the modal is to modify it.

 

I’d really appreciate any help. Thanks in advance!

Replies 3 (3)

Finer
Shopify Partner
2646 556 927

@Jey07 there are a few requirements you have to consider when you want to autoplay a video on mobile devices.

In this case, did you add the following HTML-attributes to the video-element?

autoplay mute playsinline

 

 

- Did my answer help? Mark my post with a like
- Did I solve your problem? Mark my post as an accepted solution.
- You need professional help? Contact our Shopify Partner Agency
Jey07
Visitor
3 0 0

@Finer  Yes, but that doesn’t seem to be the issue. In mobile view, the Sense theme places the video inside a modal, and the <video> element is only loaded into the HTML when you click on it.

You can see this behavior on my website: https://miubabys.com/products/scaldabiberon.

Note: I’ve implemented a script that detects when the video becomes visible on the page and automatically clicks the play button as a workaround. However, this causes a delay in loading the video, resulting in a flashing effect.

If you want to see it in action, open the Developer Tools, resize the page to simulate a mobile device, and then refresh the page.

Jey07
Visitor
3 0 0

I still can't find a solution, if someone have already experienced it and can help me