HTML CSS examples for HTML Tag:video
A video, using the browser default set of controls, with alternative sources.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of HTML video Tag with Alternate Sources</title> </head><!-- w w w.ja v a2 s . c o m--> <body> <video controls="controls"> <source src="your.mp4" type="video/mp4"> <source src="your.ogv" type="video/ogg"> Your browser does not support the HTML5 Video element. </video> </body> </html>
The following table shows the attributes that are specific to the <video> tag.
Attribute | Value | Description |
---|---|---|
autoplay | autoplay | Boolean attribute sets if video will automatically start playing. |
controls | controls | If set, the browsers will display controls to allow the user to control video playback, such as play/pause, volume, etc. |
height | pixels | Sets the height of the video's display area. |
loop | loop | Boolean attribute sets if the video will automatically start over again, upon reaching the end. |
muted | muted | Boolean attribute sets if the video will be initially silenced. The default value is false, meaning that the audio will be played when the video is played. |
poster | URL | sets an image to be shown while the video is downloading. |
preload | autometadata none | Provides a hint to the browser about whether to download of the video itself or its metadata. |
src | URL | sets the location of the video file to embed. |
width | pixels | Sets the width of the video's display area. |