Re: How to autoplay an embeded YouTube video?

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
4895 1004 1176

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
Contact us:
- Email: contact@litextension.com
websensepro
Shopify Partner
1853 215 260

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/Coding
For Free Tutorials Subscribe to our youtube
Get More Sales Using Big Bulk Discount APP
Create Your Shopify Store For Just 1$/Month
Get More Sales Using Big Bulk Discount APP