A video, using the browser default set of controls, with alternative sources. - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:video

Description

A video, using the browser default set of controls, with alternative sources.

Demo Code

ResultView the demo in separate window

<!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>

Tag-Specific Attributes

The following table shows the attributes that are specific to the <video> tag.

Attribute ValueDescription
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.
heightpixels 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 mutedBoolean 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.
posterURL 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.

Related Tutorials