Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play an embedded youtube video in loop

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.

like image 696
gigadot Avatar asked May 12 '12 16:05

gigadot


People also ask

How to remove YouTube embedded AutoPlay loop?

Click to start enjoying your video. Step 2: While the video is on the play, right-click the video and a prompt action suggestion box will pop up. Click the “loop” option and the playing video will be replay. Step 3: To remove the YouTube embedded autoplay loop, click the loop option and you are done.

How to create a YouTube replay loop?

Now start playing the YouTube video. Step 3: At the top right corner of the video are 3 dots menu. Click the dots and scroll down to the “desktop site” option and select it. Step 4: While on the mobile browser version, long-press the playing video to open the video menu. Click the “loop” option. Now your Youtube replay loop is set.

How do I loop a YouTube video on my computer?

Option 4: Using Looping sites 1 Click to open any of the above looping sites .i.e. Youtubeloop.net 2 Search for the video to set on loop. 3 Copy- paste the video URL to the top blank space of the site. 4 Click “ Go loop ” at the top right and the video is ready to play in a loop. ...

How to AutoPlay embedded YouTube videos in WordPress?

If the first method doesn’t work for you, now you can try to use the YouTube Embed plugin to autoplay embedded YouTube videos. Step 1: Here, take WordPress as an example. First, log in to the WordPress admin dashboard. Step 2: Click Plugins > Add New.


3 Answers

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/

like image 167
Chase Avatar answered Oct 19 '22 07:10

Chase


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/

like image 24
arttronics Avatar answered Oct 19 '22 09:10

arttronics


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.

like image 1
Chris Pink Avatar answered Oct 19 '22 08:10

Chris Pink