Skip to content

Quick Tip: How to use the HTML5 Video Tag

By GRAYBOX Alumni

Until now, there has not been a standard for showing a video/movie on a web page without a third-party video plugin like Flash, Silverlight or Quicktime. The control attribute on the video tag also optionally adds video controls to the player (play, pause, volume, etc).

It is a good idea to always include width and height attributes. If height and width are set, the space required for the video is reserved when the page is loaded. Without these attributes, the browser does not know the size of the video, and cannot reserve the appropriate space to it. The effect will be that the page layout will change after the video loads.

You should also insert text content between the video tags for browsers that do not support the video element.

The video element allows multiple source elements. source elements can link to different video files. The browser will use the first recognized format. Unfortunately, multiple video formats are still needed as different browsers support different formats.

Here is a how to use the video tag:

[code] Your browser does not support the video tag. [/code] 

Demo:

Your browser does not support the video tag.

Support: Internet Explorer 9 & 10, Firefox, Opera, Chrome, and Safari support the video element.

Note: Internet Explorer 8 and earlier versions, do not support the video element.

Blog & Events

Featured Work