HTML5 Audio and Video

  • Previously, we used <object> and <embed> tags
  • No need to worry about plugins like Flash.

HTML5 Audio is supported with the following tag:

<audio controls="controls">
    <source src="audiofile.mp3" type="audio/mp3" />
    <source src="audiofile.ogg" type="audio/ogg" />
    Your browser does not support the <audio> tag.
</audio>

HTML5 Video is supported with the following tag:

<video controls="controls" width="400" height="300">
    <source src="videofile.mp4" type="audio/mp4" />
    <source src="videofile.ogg" type="audio/ogg" />
    Your browser does not support the <video> tag.
</video>

Leave a Reply

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