Follow Below steps to embed a youtube video in your shopify store with autoplay, and loop.
- Go to customize
- Click on Add section
- Select Custom Liquid or Custom HTML
- Paste below code in the input box in the right sidebar.
- Replace the ID of your video which is just after embed/ and after playlist=
<style>
.youtube-container {
overflow: hidden;
width: 50%;
margin: 0 auto;
aspect-ratio: 16/9;
pointer-events: none;
}
.youtube-container iframe {
width: 300%;
height: 100%;
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/dp62sNmT4UY?controls=0&showinfo=0&playsinline=1&autoplay=1&mute=1&loop=1&playlist=dp62sNmT4UY'></iframe>
</div>