James John – Software Engineer

How to Insert/Play Videos in Webpage Using HTML5

How to Insert/Play Videos in Webpage Using HTML5

Hi all,

As I usually say, the a time will come when Jquery will fade off and HTML and CSS keep upgrading. I thought this playing of a video will be a pack of coding before this is done, but to my suprise while I was learning HTML5 I saw it there also! So let me reach it out to you guys! :D

Now just copy this code and try is out!

  1. <html>
  2. <body>
  3. <video width="320" height="240" controls autoplay>
  4. <source src="movie_link" type="movie_file_format">
  5. Your browser does not support this video, please update your browser.
  6. </video>
  7. </body>
  8. </html>
HOW THIS WORKS

<video>: This is the HTML5 Video Tag, just like <img>
width and Height: Is for the adjustment of the video size
controls autoplay: This will make the video play once it loads finish
source src: Now this tag is inside the <video> tage and it finds the source of the video
type: This is the video format, it must be in MIME format
Your browser does not support this video, please update your browser: This message will show once the video is not played

Hope it helps! :)

James John

Software Engineer