How to autoplay an embeded YouTube video?

amventures
Visitor
1 0 0

Hi friends,

I have a custom liquid section on my home page that only contains a YouTube video embedded responsively using https://embedresponsively.com/. I copied the code generated from ER to my Shopify. 

The only issue I have is I can't figure out how to play the video automatically. Code is below. 

Thank you.

<style>.embed-container { position: relative; padding-bottom: 45.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://www.youtube.com/embed//yOWdqxx4HeI' frameborder='0' allowfullscreen></iframe></div>

Replies 2 (2)

LitExtension
Shopify Partner
4860 1001 1135

Hi @amventures,

Please change all code:

<style>.embed-container { position: relative; padding-bottom: 45.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>
<div class='embed-container'>
  <iframe src='https://www.youtube.com/embed//yOWdqxx4HeI?autoplay=1&mute=1' frameborder='0' allowfullscreen></iframe>
</div>

Hope it helps!

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
websensepro
Shopify Partner
1011 139 147

Check out this video tutorial. You can use both Youtube and Hosted vid with Autoplay

Need a Shopify developer?
Hire us at WebSensePro
For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
Subscribe to our youtube channel or buy us a Cofee here