In HTML5, loop is an attribute used to specify whether to restart playback after the audio or video ends. It means loop; this attribute is a Boolean attribute. If this attribute is set, the audio or video will loop. Play, the syntax is "
".
The operating environment of this tutorial: windows10 system, html5 version, Dell G3 computer.
The loop attribute specifies that playback will restart when the audio ends.
If this property is set, the audio will play in a loop.
The loop attribute specifies that playback will restart when the video ends.
If this property is set, the video will play in a loop.
The syntax is;
<audio loop="loop" />
The example is as follows:
<!DOCTYPE HTML> <html> <body> <video controls="controls" loop="loop"> <source src="../i/movie.ogg" type="video/ogg" /> <source src="../i/movie.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </body> </html>
Output result:
(Learning video Share: css video tutorial)
The above is the detailed content of What is loop in html5. For more information, please follow other related articles on the PHP Chinese website!