Reputation: 65
Im trying to use a Youtube video as a background of a website. I have tried setting the "loop" parameter as 1 as I have readed here (https://developers.google.com/youtube/player_parameters#loop) but it doesnt work. This is the code i'm trying. All is working as intended but the loop parameter.
<iframe frameborder="0" width="100%" height="100%" src="https://www.youtube.com/embed/fcbm8SvlRYk?autoplay=1&controls=0&showinfo=0&autohide=1&loop=1"></iframe>
Am I doing something wrong? Thanks in advance! :D
Upvotes: 0
Views: 3412
Reputation: 11
Try using this code (added playlist parameter):
<iframe frameborder="0" width="100%" height="100%" src="https://www.youtube.com/embed/fcbm8SvlRYk?autoplay=1&controls=0&playlist=fcbm8SvlRYk&showinfo=0&autohide=1&loop=1"></iframe>
You should read the note in the loop parameter description located in the Google Developers link you provided:
https://developers.google.com/youtube/player_parameters#loop
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:
Upvotes: 1
Reputation: 142
Try this one For me it's perfectly working
id="id1" src="src.abc.mp4" autoplay="true" loop="true" muted="true"
Upvotes: 0
Reputation: 9151
Copy paste from the link you've provided:
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
http://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID
Upvotes: 1