Repeat youtube in loop – No page refresh or multi load – no browser plugin or 3rd party site

Many times I wish to listen to a youtube song in repeat mode; but unfortunately youtube doesn’t provide a repeat button (probably because of fake view count). Few sites let you repeat the song and the same can be done using some browser plugin too; but I don’t prefer any of them because of the following reasons.

Problem with third party site

  • Loads the video again and again; thus unnecessary bandwidth loss.
  • Displays ads for their own benifit, which is annoying to me.
  • I like youtube as youtube, not really interested browsing another site or everytime copying and pasting the youtube url in that that third party site.

Problem with browser plugins

  • I have serious security related trust issue with browser plugins, cause a browser plugin can do anything with your DOM.
  • Sometimes they also pushes advertisement in your DOM.

So what I did is wrote a JavaScript code which will just hit the replay button once your video is completed. I saved it as bookmarklet and whenever I want to repeat I just click on the bookmarklet.

Steps to do it

Adding the bookmarklet is easy and an one time effort. Steps are given below to add this in your browser.

Step 1

  • Open a new tab.
  • Click on bookmark icon.
  • Click on edit


Step 2

  • After clicking the edit button you will find a dialog box asking for bookmark name and url.
  • Give your desired name (Eg: youtube repeat)
  • Copy the ugly code below and paste in place of url.

Step 3

  • Save it. Before saving you may select the position where you want to save (bookmark bar or in some other folders)
  • That’s it. Now after opening any youtube video just click on that bookmark you saved and your video will be in repeat mode.
  • Clicking on the bookmark for the second time will stop the repeat.



Benefits of this approach

  • The video will be loaded only once. Thus your bandwidth loss will not occur.
  • Click once and any video you open in that tab will automatically fall in repeat.
  • No need to go to a third party site, you can access youtube as it is.
  • No unnecessary ads.
  • No trust issue.
About This Author

Hello! I am Paul Shan, a JavaScript Expert, Full Stack and DevOps Engineer cum Consultant based out of Bengaluru, India.

  • Rameez Aftab

    this doesn’t work !!!! any further help will be appreciated..

  • FervidWhirl Disc

    i don’t have a yellow star in address bar, what is the other way to enter this edit options?

    • Paul Shan

      All browsers support bookmarking. All you need to do is to bookmark the code