HTML5 Media
Objectivesβ
By the end of this chapter, you should be able to:
- Embed audio and video into an HTML page
- Define what an iframe is and list use cases for using one
With HTML5 comes the ability to embed audio and video into our HTML. We can do this using the audio tag and video tag. You can read more about the audio tag here, and the video tag here.
iframe (inline frame)β
A bit of an older tool that you will see sometimes is an <iframe></iframe>
tag. The iframe tag is used to embed another document (HTML page) within the current page. You can read more about it here. For more on how they are (or are mostly not) used today, check out this Stack Overflow question.
Although you will rarely be creating your own iframe tags, it is very common to embed content from other websites on your page through an iframe tag. You can read how to embed an audio player from Spotify here and a YouTube video here.
When youβre ready, move on to Intermediate HTML Exercise