How to Make a Video Loop Repeatedly in HTML

HTML




In this article, we show how to make a video loop over and over again repeatedly so that when the video finishes, it starts over again and this process continues forever, or until the user stops the video or the user leaves the page.

We've all seen these looping videos on pages on the web, such as Twitter where a video finishes and then goes back to start and plays over again.

To make a video loop over and over again, all we need to do is modify the HTML code.

To do this, we can add the word, loop, to the video tag used to show the video.

This is shown in the code below.



So all you have to do to make a video loop over and over again repeatedly is to add the word, loop, to the HTML video tag.

Below is a video that does just that, loops over and over again, and only stops until a user stops it.



If you want to download this video, you can do so at the following link: Short Video

The full HTML code for the looping video above is shown below.



So let's go over this code.

So we use the standard video tag in HTML to display a video on a web page.

We choose the width of the video of 240px, but you can change this to any value you want.

We add controls to the video so that the user can do things such as start or stop the video.

We then add the word, loop, to the video tag, so that the video loops over and over repeatedly.

We want this video to start as soon as the page is loaded, so we add the word, autoplay, to the video tag.

We then have the standard video src to specify the path to the video and the type of video file we will be playing in the type attribute.

And this is how to make a video loop over and over repeatedly in HTML.


Related Resources

How to Play an Audio File Using HTML

How to Upload Videos to a Website Using PHP

How to Insert Videos into a MySQL Database Using PHP

How to Create a Video Search Engine For Your Website Using PHP

How to Create Your Own File Transfer Protocol (FTP) For Your Website Using PHP

How to Upload Images to a Website Using PHP

How to Upload Files to a Website Using PHP

How to Create a Search Engine Using PHP

How to Insert Images into a MySQL Database Using PHP

HTML Comment Box is loading comments...