How to embed a YouTube video on a website without displaying “related videos” at the end?

15 September, 2021



embed a video play in loop

 

This tip will allow you to play in loop an embedded video. Last time I have tested it it was in august 2021.

 

With this tip when your YouTube video ends, the video restarts again instead of showing other videos.

 

To get the basic HTML code to embed a video from the YouTube website:

 

Click SHARE . From the list of Share options, click Embed. From the box that appears, copy the HTML code.

 

The HTML code from YouTube looks like this:

 

<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" 
title="YouTube video player" frameborder="0" 
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
allowfullscreen>
</iframe>

The VIDEO_ID on the HTML code above is the unique id of the video.

 

The basic code can be modified to play the video in loop:

<iframe width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1" 
title="YouTube video player" frameborder="0" 
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 
allowfullscreen>
</iframe>

 

Only the line bellow has to be modified:

src="https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1"

Make sure to replace both VIDEO_ID in the code with your video ID. There is no need to create a playlist.

 

Now you know how to embed a nice video that will play in loop, which is useful to have on a landing page or an article of a blog.

 

And if you want to create a video with beautifull voice in record time, check the video generator of Rollideo. It can turn any text into a video.