Reputation: 8969
Does anyone know how to make an embedded youtube video to play in loop?
I have tried the code generated from official youtube developer website but it does not work at all. It doesn't replay after the video ends in both Firefox and Chrome. Here is the generated code that doesn't work.
<object style="height: 390px; width: 640px">
<param name="movie" value="https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344">
</object>
I have tried to google it but there aren't any good instruction.
Upvotes: 12
Views: 25346
Reputation: 2027
I have exhausted the possibilities with Youtube. If nothing else it's a bandwidth sucker as the video is reloaded each time.
I've uploaded my looping video to Vimeo. Problem solved.
Upvotes: 1
Reputation: 9955
I can not leave a comment for Chase's accepted answer, but to have the Playlist show only ONE video and not two, just use the comma which separates video id's and allows Playlist of 1 to be realized.
Example:
&playlist=,
jsfiddle update:
http://jsfiddle.net/E3Euv/1/
Upvotes: 4
Reputation: 29549
Try taking a look here https://developers.google.com/youtube/player_parameters#loop
Taken from the link
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
It appears that you may be missing the playlist parameter needed in conjunction with the loop paramenter.
Demo link: http://jsfiddle.net/E3Euv/
Upvotes: 35