Video element

Typical video element code:

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

notes:

  • The controls attribute – control panel with play/stop/volume/progress widgets will be displayed
  • browser use first format it recognizes  (mp4 first then ogg format in this case, and so on). browsers may use a different heuristic and choose a “preferred” format.
  • The <video> element is a DOM member, so  CSS styling can be applied, as well as manipulation using the DOM API.

Supported by browsers:

video element support.PNG

RESTRICTION: YOU CANNOT EMBED A YOUTUBE OR DAILYMOTION VIDEO USING THE <VIDEO> ELEMENT

How to use for youtube example:

  1. width=“560” height=“315”src=https://www.youtube.com/embed/ZH1XOsv8Oyo&#8221; frameborder=“0”allowfullscreen>

The recommended codec that works on most browsers, as of 2015:
H264/mp4

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s