What is "html5-video"

HTML5 Video is an element introduced in the HTML5 specification project for the purpose of creating a standard-compliant, free-from-need plugins for video and movie playback, partially replacing the element - object.

Basic use

We can incorporate an element of vídeo in an HTML5 document using the following code:

<video width="320" height="240" controls="controls">
   <source src="filme.ogg" type="video/ogg">
   <source src="movie.mp4" type="video/mp4">
   <source src="movie.webm" type="video/webm">
   <p>O seu navegador não supporta a tag video.</p>
</video>

Attributes

The element video has the following specific attributes:

  • src indicates the address of a media file to be displayed
  • crossorigin are the CORS attribute settings
  • poster indicates the address of an image file that can be displayed until available video data is available
  • preload sets the video preload behavior, the values being valid none, metadata and auto
  • autoplay is an attribute boolean. When present, the video will automatically start playing as soon as available, non-stop
  • mediagroup can be used to interconnect various media elements together implicitly creating a Mediacontroller
  • loop is a boleane attribute which, if specified, indicates that the element shall look for ways to return to the beginning of the resource upon reaching its end
  • muted is a boolean attribute that controls the default state of audio output of the media resource, potentially overriding user preferences
  • controls is a boolean attribute that defines whether or not the standard audio/video controls set should be displayed in the browser
  • width and height specifies the dimensions of the element in pixels