Videos can be embedded in HTML pages with several methods.

Code to add Video player using HTML5

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.webm" type="video/webm">
  <object data="movie.mp4" width="320" height="240">
    <embed src="movie.swf" width="320" height="240">

The <embed> tag defines a container for external (non-HTML) content.

The following HTML fragment displays a Flash video embedded in a web page:

<embed src="intro.swf" height="200" width="200">


  • If the browser does not support Flash, the video will not play
  • iPad and iPhone do not support Flash videos

The HTML5 <video> tag defines a video or movie.

The <video> element works in all modern browsers.

The following example uses the HTML5 <video> tag, which specifies one

MP4 file (for Internet Explorer, Chrome, Firefox 21+, and Safari), and one OGG

file (for older Firefox and Opera). If something fails, it will display a text:

  • You must convert your videos to many different formats
  • The <video> element does not work in older browsers
  Modified On Sep-18-2014 01:24:21 PM

Leave Comment