stan krzyzanowski

| categories | image chronology | text chronology | exhibitions & projects | contact info and help | process & practice |


HTML Loop Video
To force a video to play as a loop in HTML, you need to add the
loop attribute to the <video> tag [1, 2]. 
The loop attribute is a boolean attribute, meaning its presence alone is enough to enable the feature. 
Example Code
html

<video controls width="600" loop>
<source src="your-video-file.mp4" type="video/mp4">
<source src="your-video-file.ogg" type="video/ogg">
Your browser does not support the video tag.
</video> or try: <video controls width="600" loop>
<source src="your-video-file.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

Key Components Explained
Forcing Autoplay and Muting
If you want the video to start playing as soon as the page loads and loop, you can add the autoplay and muted attributes. Videos with autoplay must also include the muted attribute to function in most modern browsers due to browser restrictions on sound [2]. 
html

<video autoplay muted loop controls width="600">
<
source src="your-video-file.mp4" type="video/mp4">
<
source src="your-video-file.ogg" type="video/ogg">
Your browser does not support the video tag.
</
video> or try: <video autoplay muted loop controls width="600">
<
source src="your-video-file.mp4" type="video/mp4">
Your browser does not support the video tag.
</
video>