Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to loop an embeded YouTube video?

I am embedding a YouTube video without playback controls, or video title, but I want it to autoplay and loop. Everything works except the loop. What am I doing wrong?

<div class='embed-container'><iframe src="https://www.youtube.com/embed/Yo19ZhO7CAc?autoplay=1&loop=1&cc_load_policy=1rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe></div>
like image 922
user1724434 Avatar asked Feb 05 '16 18:02

user1724434


1 Answers

You shoud add playlist=VIDEO_ID at your src

<div class='embed-container'>
  <iframe 
      src="https://www.youtube.com/embed/Yo19ZhO7CAc?autoplay=1&loop=1&cc_load_policy=1rel=0&amp;controls=0&amp;showinfo=0&playlist=Yo19ZhO7CAc" 
      frameborder="0" 
      allowfullscreen>
  </iframe>
</div>
like image 149
Mr. Nobody Avatar answered Sep 21 '22 07:09

Mr. Nobody