Reputation: 115
I have this piece of code and I want the video to automatically play (which it is doing now) but I also want it to loop and I can't seem to find a way to do both.
<iframe width="1280" height="720" src="https://www.youtube.com/embed/x5zQ5dr1qR4?autoplay=1" frameborder="0" allowfullscreen></iframe>
And these are the parameters that I want to add
playlist=x5zQ5dr1qR4&loop=1
Upvotes: 0
Views: 4146
Reputation: 56
Just add parametres loop=1 and playlist with value of original video code:
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:
https://www.youtube.com/v/VIDEO_ID?
version=3
&loop=1
&playlist=VIDEO_ID
https://www.youtube.com/embed/x5zQ5dr1qR4?autoplay=1&loop=1&playlist=x5zQ5dr1qR4
It's working for me just fine.
Upvotes: 1