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!