Google Ads

HTML5 Video Player HTML Code

Here is HTML5 Video Player HTML Code.

Playing Videos in HTML

Before HTML5, a video could only be played in a browser with a plug-in (like flash).

The HTML5 <video> element specifies a standard way to embed a video in a web page.

This code will work for Android, Windows, iPhone and more devices which supports html.

  1. <video width="320" height="240" 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 tag.
  5. </video>
  6. or
  7. <video width="320" height="240" controls>
  8. <source src="" type="video/mp4">
  9. <source src="" type="video/ogg">
  10. Your browser does not support the video tag.
  11. </video>
How it Works

The controls attribute adds video controls, like play, pause, and volume.

It is a good idea to always include width and height attributes. If height and width are not set, the page might flicker while the video loads.

The <source> element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.

The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.



Have any Question or Comment?

One comment on “HTML5 Video Player HTML Code

Leave a Reply

Your email address will not be published. Required fields are marked *