Auto-playing YouTube Videos in Shopify Ride Theme

Hey everyone! I need some help with the Shopify Ride theme. I have a YouTube video configured in my settings that I want to automatically start when visitors come to my homepage.

In my theme settings, I can see the video URL is stored like this:

"video_link": "https:\/\/www.youtube.com\/watch?v=ABC123XYZ"

The theme uses this template code to display videos:

<div>
{%- if settings.video_link.type == 'youtube' -%}
<iframe src="https://www.youtube.com/embed/{{ settings.video_link.id }}?enablejsapi=1" class="youtube-player" allow="autoplay; encrypted-media" allowfullscreen title="{{ settings.video_description | escape }}"></iframe>
{%- else -%}
<iframe src="https://player.vimeo.com/video/{{ settings.video_link.id }}" class="vimeo-player" allow="autoplay; encrypted-media" allowfullscreen title="{{ settings.video_description | escape }}"></iframe>
{%- endif -%}
</div>

I tried adding the autoplay parameter to the YouTube URL but it’s not working. The video still requires users to click play manually. Has anyone successfully implemented autoplay for videos in this theme? Any suggestions would be really helpful!

Had this same problem with the Ride theme last month. YouTube’s autoplay policy got way stricter - videos only autoplay when they’re muted by default. You need both autoplay=1 and mute=1 in your iframe src. Try this: src="https://www.youtube.com/embed/{{ settings.video_link.id }}?enablejsapi=1&autoplay=1&mute=1". Just heads up - autoplay works differently across browsers and devices. Most mobile browsers block it completely to save bandwidth. Plus some people find autoplay annoying, so maybe add a JavaScript toggle so they can unmute if they want sound.