Audio and Video Tag in Web Pages using HTML5

This post discusses adding audio and video tags in the web pages using HTML5.

Audio and Video Tag in Web Pages using HTML5 

 
In HTML5, some new tags have been introduced such as audio and video.
 
For Video
  1. <html>  
  2.     <head></head>  
  3.     <body>  
  4.         <video controls="controls" width="200">  
  5.             <source src="filename.mp4" />  
  6.         </video>  
  7.     </body>  
  8. </html>  
Output
 
For audio with control:
  1. <html>  
  2.     <head></head>  
  3.     <body>  
  4.         <audio controls="controls">  
  5.             <source src="filename.mp3"  />  
  6.         </audio>  
  7.     </body>  
  8. </html>  
Output

For audio auto play:
  1. <html>  
  2.     <head></head>  
  3.     <body>  
  4.         <audio autoplay>  
  5.             <source src="filename.mp3" />  
  6.         </audio>  
  7.     </body>  
  8. </html>