Chapter 7Multimedia: Using Native HTML5 Audio
In this chapter, we'll cover the
audio element and
its attributes. Though we're focusing on the
element, keep in mind that most of these attributes also apply to
video. In fact, it's possible to use the
audio element to play video files and the
video element to play audio files. The main difference is
video element will display an image track if it
audio never will.
Adding audio to your web page is super simple. Use the
<audio> tag. At a minimum, it requires a
src attribute, which is the path to and name of the
media file. Audio elements also require a closing
</audio> tag. Using your text editor, create a new HTML file, and add the snippet below, changing ...