Youtube video loop hack (javascript)

Sometimes i want to listen to music from Youtube over and over, but i don’t like to hit play every time. As Youtube player don’t have the repeat button, i wrote an script to do it for me.

Just copy and paste the following code on your browser’s address bar (you can create a bookmark with this code).

javascript:swfUrl=%22/v/%22+swfArgs.video_id +%22&autoplay=1&loop=1%22;writeMoviePlayer(%22playerDiv%22, true);void(null);

[20080416 15h30] update
Youtube crew has recently modified the name of the video div container. Now it is working again (you can create a bookmark with this code).


  1. Marco Gomes said,

    January 21, 2008 @ 21:13

    Try to make playlists with YT and other streaming services.

  2. Princess Sarah said,

    April 8, 2008 @ 02:51

    thank you!!! this is gold!

  3. Tuna said,

    April 9, 2008 @ 11:41

    thanks!! great script

  4. hotdogski said,

    June 1, 2008 @ 19:39

    How to make this work with the movie fullscreen?


  5. tom said,

    June 28, 2008 @ 10:27

    How do I use this code? I always get a malformed video id.

  6. dcfghjksdfg said,

    October 29, 2008 @ 02:41


  7. qaz70 said,

    July 1, 2010 @ 08:38

    How do you use this code? Is the java script inserted at the end of the youtube url address? Thanks for any feedback.

  8. Repeat Youtube said,

    July 12, 2012 @ 09:29

    Just go to and it will repeat your videos automatically (or just parts of them)

RSS feed for comments on this post · TrackBack URI

Leave a Comment