Media Code in HTML5

/ Published in: HTML
Save to your folder(s)

This example is a basic design structure for loading multiple video and audio formats for universal work of media content on your page.

Copy this code and paste it in your HTML
  1. <video poster="images/preview.png" width="800" height="600" controls="controls" preload="none">
  2. <source src="media/my_video.mp4" type="video/mp4"></source>
  3. <source src="media/my_video.webm" type="video/webm"></source>
  4. <source src="media/my_video.ogg" type="video/ogg"></source>
  5. </video>
  6. <audio controls="controls" preload="none">
  7. <source src="audio/my_music.ogg" type="audio/ogg">
  8. <source src="audio/my_music.mp3" type="audio/mpeg">
  9. </audio>


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.