The Wayback Machine - https://web.archive.org/web/20240919211743/https://www.geeksforgeeks.org/html-video-loop-attribute/
Open In App

HTML | <video> loop Attribute

Last Updated : 15 Jul, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The HTML <video> loop Attribute is used to restart the video again and again after finishing it. It contains the Boolean value. This tag is new in HTML5. 

Syntax:

<video loop>

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML video loop Attribute</title>
</head>
 
<body>
    <center>
        <h1 style="color:green;">GeeksforGeeks</h1>
 
        <h3>HTML video loop Attribute</h3>
 
        <video width="400" height="200" controls loop>
            <source src=
                                     type="video/mp4">
            <source src=
                                     type="video/ogg">
        </video>
    </center>
</body>
 
</html>
</html>


Output:

  

Note: Always specify the width and the height of the video else web page will be confused that how much space that video will be required due to that reason web page become slow down.

Supported Browsers: The browser supported by HTML <video> loop Attribute are listed below:

  • Google Chrome 3.0 and above
  • Edge 12.0 and above
  • Internet Explorer 9.0 and above
  • Firefox 11.0 and above
  • Safari 3.1 and above
  • Opera 10.5 and above

Previous Article
Next Article

Similar Reads

How to loop through HTML elements without using forEach() loop in JavaScript ?
In this article, we will learn how to loop through HTML elements without using the forEach() method. This can be done in the following ways: Table of Content Approach 1: Using the for loopApproach 2: Using the While loopApproach 3: Using the 'for.....of' statementApproach 4: Using the for...in statementApproach 1: Using the for loopThe HTML element
4 min read
HTML DOM Video loop Property
The Video loop property is used for setting or returning whether a video should start playing over again when it is finished or not. Syntax: Returning the loop property:videoObject.loopSetting the loop property:videoObject.loop = true|false Property Values: true | false: It is used to specify whether the video should start playing over again, every
2 min read
HTML | &lt;audio&gt; loop Attribute
The HTML &lt;audio&gt; loop Attribute is used to restart the audio again and again after loading the web page. It contains the Boolean value. This tag is new in HTML 5. Syntax: &lt;audio loop&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt; HTML Audio loop Attribute &amp;lt;/title
1 min read
HTML Marquee loop attribute
The Marquee loop attribute in HTML is used to define the number of times the marquee should loop. The HTML Marquee loop attribute, when set to a positive integer, determines the number of times a marquee element will repeat its scrolling behavior. A loop value of "-1" signifies an infinite loop. Note: The default value of the loop is INFINITE and t
2 min read
HTML loop Attribute
The HTML loop Attribute is used to restart the audio and video again and again after finishing it. It contains the Boolean value.  Syntax:   &lt;element loop&gt;Applicable   &lt;audio&gt;&lt;video&gt;&lt;marquee&gt;&lt;bgsound&gt;Example 1: Below Example illustrates the use of loop attribute in &lt;audio&gt; element.   [GFGTABS] html &lt;!DOCTYPE h
2 min read
HTML &lt;video&gt; crossorigin Attribute
The HTML crossorigin attribute is used in the &lt;video&gt; element that supports a CORS request when we tried to fetch out the video files from the third-party servers or from another domain. Syntax: &lt;video crossorigin="anonymous | use-credentials"&gt; Attribute Values: anonymous: It has a default value. It defines a CORS request that will be s
1 min read
HTML | &lt;video&gt; height Attribute
The HTML &lt;video&gt; height attribute is used to specify the height of the video player in terms of pixels. Syntax: &lt;video height="pixels"&gt; Attribute Values: It contains single value pixels which specifies the height of the video player in terms of pixels. Below example illustrates the use of height attribute in &lt;video&gt; element: Examp
1 min read
HTML | &lt;video&gt; controls Attribute
The HTML &lt;video&gt; controls Attribute is used to specify the control to play video. It is the Boolean value. This attribute is new in HTML5. The video control should include: PlayPauseVolumeFull-screen ModeSeekingCaptions/Subtitles(if available)Track(if available) Syntax: &lt;video controls&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt;
1 min read
HTML | &lt;video&gt; src Attribute
The HTML &lt;video&gt; src Attribute is used to specify the URL of the video file. This attribute uses Ogg file on Firefox, Opera and Chrome browsers and MPEG4 file on Internet Explorer and Safari browsers. This attribute is new in HTML5. Syntax: &lt;video src="URL"&gt; Attribute Values: It contains a single value URL which specifies the link of so
1 min read
HTML | &lt;video&gt; poster Attribute
The HTML &lt;video&gt; poster Attribute is used to display the image while video downloading or when user click the play button. If this image not set then it will take the first frame of video as a poster image. Syntax: &lt;video poster="URL"&gt; Attribute Values: It contains a single value URL which specifies the link of source image. There are t
1 min read
HTML | &lt;video&gt; muted Attribute
The HTML &lt;video&gt; muted Attribute is used to specify the audio output of the video is muted, it is a Boolean attribute. Syntax: &lt;video muted&gt; Example: C/C++ Code &amp;lt;!DOCTYPE html&amp;gt; &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt; HTML Video muted Attribute &amp;lt;/title&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;bod
1 min read
HTML | &lt;video&gt; preload Attribute
The HTML audio preload Attribute is used to specify the way the author thinks the video should be loaded when the page loads. The video preload attribute allows the author to portray to the browser about the way the user experience of a website should be implemented. Syntax: &lt;video preload="auto | metadata | none"&gt; Attribute Values: auto: It
1 min read
HTML &lt;video&gt; height Attribute
The height attribute in the HTML &lt;video&gt; element specifies the height of the video player in pixels, controlling the vertical size of the video display area within the webpage. HTML &lt;video&gt; height Attribute Syntax:&lt;video height="pixels"&gt;HTML &lt;video&gt; height Attribute Values:It contains single-value pixels which set the height
2 min read
What is use of poster attribute in the HTML video Tag?
The "poster" attribute in &lt;video&gt; Tags are used to specify an image that represents the video content before the video is played or while the video is loading. This attribute allows developers to display a custom poster image, such as a thumbnail or a promotional image, to provide a visual preview or context for the video content. Syntax&lt;v
2 min read
HTML &lt;video&gt; autoplay Attribute
HTML &lt;video&gt; autoplay attribute is used to specify that the video will play automatically after loading the web page. It is the Boolean value, this attribute is new in HTML5.  Syntax: &lt;video src="" autoplay&gt;HTML &lt;video&gt; autoplay attribute ExamplesExample: Here is the basic implementation of the HTML &lt;video&gt; autoplay attribut
2 min read
HTML &lt;video&gt; width Attribute
HTML &lt;video&gt; width Attribute is used to specify the width of the video display area in pixels of its container element's width. Note: Always specify the width and the height of the video else the web page will be confused about how much space that video will require due to that reason web page slows down. Syntax:  &lt;video width="pixels"&gt;
1 min read
How to Loop Through an Array using a foreach Loop in PHP?
Given an array (indexed or associative), the task is to loop through the array using foreach loop. The foreach loop iterates through each array element and performs the operations. PHP foreach LoopThe foreach loop iterates over each key/value pair in an array. This loop is mainly useful for iterating through associative arrays where you need both t
2 min read
How href attribute is different from src attribute in HTML ?
In HTML5, the href and src attributes play distinct roles in defining paths or URLs, each associated with specific HTML elements. The href attribute, commonly found in an anchor (&lt;a&gt;) elements, points to the destination of hyperlinks, facilitating navigation. The src attribute, used with elements like &lt;img&gt; and &lt;script&gt;, specifies
1 min read
Difference between Compunent Video and S-Video
1. Compunent Video :: It is also know as RCA video. This video has been split into two or more component channels. This is provide a high quality of picture Composite video are contains both the chrominance and luminance information, along with synchronization and blanking pulses. 2. S-Video : It is also known as separated video. This is provide a
2 min read
How to make HTML5 Video Poster be same Size as Video Itself ?
To make an HTML5 video poster the same size as the video itself to achieve this you can use the HTML5 &lt;video&gt; elements, you can specify a poster frame that will be displayed before the video starts playing. To ensure that the poster image is the same size as the video itself, you should use an image with the same dimensions as the video. Belo
3 min read
When to use the class attribute and the id attribute ?
The class attribute is used when multiple HTML elements share a common style or behaviour, allowing the application of a shared style to several elements. It promotes code reusability and is suitable for elements with similar characteristics. The id attribute is utilized when a unique identifier is needed for a specific HTML element. This identifie
1 min read
How to use the target attribute and the rel attribute in the &lt;a&gt; Tag ?
The target and rel attributes in the &lt;a&gt; (anchor) tag is used to control the behaviour of hyperlinks, specifying how the linked content should be opened and establishing relationships between the current and linked documents. Here's how to use these attributes: target Attribute:The target attribute determines where the linked content will be
2 min read
HTML | &lt;html&gt; xmlns Attribute
The HTML &lt;html&gt; xmlns Attribute is used to specify the xml namespace for a document. Important Note: This attribute is mainly required in XHTML, not valid in HTML 4.01, and optional in HTML 5. Syntax: &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; Attribute Values: https://www.geeksforgeeks.org/ It defines the namespace to use (for XHTML d
1 min read
HTML DOM Audio loop Property
The Audio loop property is used for setting or returning whether an audio should start playing over again when it is finished or not. Syntax: Return the loop property:audioObject.loopSet the loop property:audioObject.loop = true | false Property Values: true | false: It is used to specify whether the audio should start playing over again, every tim
2 min read
HTML DOM Marquee loop Property
The Marquee loop property in HTML DOM is used to set or return the value of the loop attribute of the &lt;marquee&gt; element. The loop attribute is used to specify the number of times the marquee text should loop. Syntax: It returns the marquee loop property. marqueeObject.loop; It sets the marquee loop property. marqueeObject.loop ="number"; Note
2 min read
HTML Collection for Loop
An HTMLCollection for loop is used to iterate over a collection of HTML elements, like those returned by getElementsByTagName() or getElementsByClassName(). Use a for loop, for...of the loop, or convert the collection to an array with Array.from() for easy iteration. Note: It is not recommended to use a for...in loop for iterating over an HTMLColle
4 min read
HTML | DOM Video seekable Property
The Video seekable property is used for returning a TimeRanges object. The TimeRanges object is used for representing the ranges of the video which are available for seeking by the user. The time-range of video which is available for seeking i.e. moving playback position is called a seekable range. It is often possible to seek anywhere in the video
2 min read
HTML DOM Video playbackRate Property
The Video playbackRate property in HTML DOM is used to set or return the current playback speed of the video. The video playbackRate property returns a number that represents the current playback speed. Syntax: It returns the Video playbackRate property.videoObject.playbackRateIt is used to set the Video playbackRate property.videoObject.playbackRa
2 min read
HTML | DOM Video paused Property
The Video paused property in HTML DOM is used to return whether the video is paused or not. It is the read-only property. Syntax: videoObject.paused Return: The video paused property returns a boolean value true if the video is paused else return false. Below program illustrates the Video paused property in HTML DOM: Example: &lt;!DOCTYPE html&gt;
1 min read
HTML DOM Video Object
The Video object in HTML DOM represents an &lt;video&gt; element. The video element can be accessed by using getElementById() method. Syntax: To access a video object: document.getElementById("videoId");where id is assigned to the &lt;video&gt; tag.To create a video object: document.createElement("VIDEO"); Property Values: ValueDescriptionaudioTrac
4 min read