Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

HTML Video


HTML 5 supports <video> tag also. The HTML video tag is used for streaming video files such as a movie clip, song clip on the web page.

Currently, there are three video formats supported for HTML video tag:

  1. mp4
  2. webM
  3. ogg

Let’s see the table that defines which web browser supports video file format.

Browser mp4 webM ogg
ie_browser Internet Explorer yes no no
chrome_browser Google Chrome yes yes yes
firefox_browser Mozilla Firefox yes yes yes
opera_browser Opera no yes yes
safari_browser Apple Safari yes no no

Android also supports mp4 format.

HTML Video Tag Example

Let’s see the code to play mp4 file using HTML video tag.

  1. <video controls>
  2.   <source src=“movie.mp4” type=“video/mp4”>
  3.   Your browser does not support the html video tag.
  4. </video>

Test it Now

Let’s see the example to play ogg file using HTML video tag.

  1. <video controls>
  2.    <source src=“movie.ogg” type=“video/ogg”>
  3.   Your browser does not support the html video tag.
  4. </video>

Supporting Browsers

Element chrome_browser Chrome ie_browser IE firefox_browser Firefox opera_browser Opera safari_browser Safari
<video> Yes Yes Yes Yes Yes

Attributes of HTML Video Tag

Let’s see the list of HTML 5 video tag attributes.

Attribute Description
controls It defines the video controls which is displayed with play/pause buttons.
height It is used to set the height of the video player.
width It is used to set the width of the video player.
poster It specifies the image which is displayed on the screen when the video is not played.
autoplay It specifies that the video will start playing as soon as it is ready.
loop It specifies that the video file will start over again, every time when it is completed.
muted It is used to mute the video output.
preload It specifies the author view to upload video file when the page loads.
src It specifies the source URL of the video file.

HTML Video Tag Attribute Example

Let’s see the example of video tag in HTML where are using height, width, autoplay, controls and loop attributes.

  1. <video width=“320” height=“240” controls autoplay loop>
  2.   <source src=“movie.mp4” type=“video/mp4”>
  3.   Your browser does not support the html video tag.
  4. </video>

Test it Now


MIME Types for HTML Video format

The available MIME type HTML video tag is given below.

Video Format MIME Type
mp4 video/mp4
ogg video/ogg
webM video/webM

Comments

comments