November 6, 2012

Quick Tip: How to use the HTML5 Video Tag

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.

Paul Weinert
Author

Paul Weinert is our founder, managing principal and spirit animal. He’s one of those odd people you meet that was born in Portland, grew up here and still lives here for some reason. If you had two words to describe Paul after meeting him, we’d bet you’d use “charmingly quirky”.

Paul started GRAYBOX in February 2009, and for the first four years, GRAYBOX had a blend of a contract staffing firm and a traditional agency. GRAYBOX then hired our first employees in 2012 and has been growing ever since. Professionally, Paul has a background in internet business consulting, working especially with mid-market ecommerce, healthcare, and tech companies. He worked as a user experience designer, web developer and internet marketer. Nowadays, Paul serves as our company visionary, team mentor and head of executive leadership — Paul is extremely proud of the entire team and the company. He’s constantly humbled by the team’s awesomeness and the caring community that’s sprung up from his initial ideas.

Beyond GRAYBOX, Paul is married, has two young boys and lives in NE Portland. He’s also an active foster parent, mentors other local entrepreneurs, and volunteers on local non-profit boards. Businesswise, aside from GRAYBOX, Paul has started a few other businesses and is an active investor in the local startup scene.

For the sheer joy of it, let’s play 2 truths and a lie:

  1. Paul firmly believes that any activity would be better if on a boat.
  2. Other than this whole Internet thing, Paul has basically no other skills or expertise in anything.
  3. Paul is rare unicorn, actually born and raised in Portland.