Welcome to CodeCrew Infotech

shape shape
Shape Shape Shape Shape
Blog

How To Add Autoplay Youtube Video In Shopify Home Page

Video is the most poerful wepon for engaging the customer in your Shopify store. The most effective and quick way to show your products or services is that Autoplaying video in ypu Shopify store home page.

In this blog we will show you how to add the autoplay video in your shopify store's home page. we will also customizing the autoplay in your section.

Step 1: go to Shopify admin and follow these steps:

Shopify admin > Themes > Customization/

Step 2: Search the Custom liquid or Custom HTML section on the left sidebar.

Step 3: Paste the below code in the input box in the right sidebar.

Step 4: Whenever you want to upload the new video replace the ID of your video after embedding/ and after playlist=

            For example, here we change the ID is: fIkBP9bfse0.

   <style>

    .youtube-container {

       overflow: hidden;

       width: 70%;

       margin: 0 auto;

       aspect-ratio: 16/9;

       pointer-events: none;

   }

   .youtube-container iframe {

       width: 300%;

       height: 80%;

       margin-left: -100%;

   }

  @media screen and (max-width: 800px) {

      .youtube-container {

        width: 90%;

      }

  }

   </style>

   <div class='youtube-container'>

        <iframe src='https://www.youtube.com/embed/fIkBP9bfse0?       controls=0&showinfo=0&playsinline=1&autoplay=1&mute=1&loop=1&playlist=fIkBP9bfse0'></iframe>

   </div>