YouTube recently discarded the old "embed" code and replaced it with iframe code.
In the new iframe code I found the way to loop+autostart videos on my website, thanks to this article. It says:
It's important to note that the “loop” parameter needs to work together with the “playlist” parameter. This means that we are looping a playlist that has only one video. So the embed code will look like this:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/V3oJR5IAMxM?rel=0&autoplay=1&loop=1&playlist=V3oJR5IAMxM” frameborder=”0″ allowfullscreen></iframe>
But in my new code, why does each plalist have the two same videos?
When I apply the code the playlist, it has the same two videos in it. See for example:
How can I have only one video per playlist? I never created any playlists. YouTube shows by default that I have the same 2 videos in a playlist.
This is the correct way to loop the videos of a playlist (as Google explains here)
<iframe width="100%" height="100%" src="http://www.youtube.com/embed?
listType=playlist&
list=PLAYLIST_ID&
version=3&
loop=1&
autoplay=1&
rel=0&
showinfo=0&
controls=0&
autohide=1
" frameborder="0" allowfullscreen></iframe>
I came here with a similar question. That question has been solved, heres how i did it. Where you link the source, just get the original embed code, then replace the part that says embed with v. ex:
www.youtube.com/v/lG5aSZBAuPs
(embed was originally here, now its a v)
Now add these attributes (or whatever the name for them would be) to the end of that embed link:
so at the end the link should look like so:
<iframe width="853" height="480" src="//www.youtube.com/v/lG5aSZBAuPs&autoplay=1&loop=1&playlist=lG5aSZBAuPs" frameborder="0" allowfullscreen></iframe>
Copy the YouTube Embedded code then make these amendments.
This gives:
<iframe width="420" height="315" src="//www.youtube.com/v/agAX34aHvCM&autoplay=1&loop=1&playlist=agAX34aHvCM" frameborder="0" allowfullscreen></iframe>
There are so many people having trouble with this.....
Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With