Make your YouTube videos loop and autoplay

Print Friendly, PDF & Email

Update on 15 Jun 2022: There is another way to loop videos using YouTube Music.

How do you make your interested YouTube videos or playlists autoplay and loop forever? By googling a while, I found a way for doing this although I think that it could be difficult for a number of audiences. However, it helps me solve my need at least. Following are the steps I used to do my own simple autoplay/loop YouTube player.


Create an HTML page with the following content

<!DOCTYPE html>
<title>Chương trình nghe nhạc Youtube</title>
	#myhtml5player {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		display: inline-block;
		margin: auto;
<div id="wrapper" style="text-align: center">    
	<div id="myhtml5player">
	<h1>Chuong trinh nghe nhac</h1>
	<iframe id="ytplayer" type="text/html" width="800" height="640"
  <!-- src="" -->

Go on YouTube, and get a video id or playlist id that you want to play. Then replace the value following the attribute list with it (i.e. PL2F99_jPfm5rCC-uU4lhqfQ5WtYltyBj1).

If you want to play a video, alter the value of the attribute src with the link in the comment below (in the snapshot) and use video id instead.

Open the HTML web page you have created in Google Chrome. The result would look like the following image.

Chương trình nghe nhạc YouTube tự động và lặp lại
Chương trình nghe nhạc YouTube tự động và lặp lại


Will be updated soon.

Functionalities should be added:

  • Allow changing videos/playlists via the friendly web interface.
  • Off/On autoplay/loop.
  • Insert a customised autoplay/loop YouTube player into this page.
  • Provide downloadable materials for audiences.
  • Allow our audiences to create their own autoplay/loop YouTube player and download it.


Music Player on YouTube


[1] YouTube Embedded Players and Player Parameters

One thought on “Make your YouTube videos loop and autoplay

Leave a Reply

Your email address will not be published. Required fields are marked *



This site uses Akismet to reduce spam. Learn how your comment data is processed.