This community-built FAQ covers the “Video and Embed” exercise from the lesson “Semantic HTML”. Note that the embed tag is deprecated can you should use img, picture, video or iframe tags instead.
Paths and Courses
This exercise can be found in the following Codecademy content:
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in #get-help.
Agree with a comment or answer? Like () to up-vote the contribution!
Hi all, fairly new to all this and I just have a question about the link for the files. does the + do anything between say “Semantic+HTML” or is that just how the file path was named?
Also, on the previous exercise we covered some attributes that we can enclose in the media tags (
Lastly, I’m just starting with the basics of HTML and I’m not a paid subscriber (still evaluating if this is something I can really pursue) from anyone out there who is a paid subscriber, just how much am I missing out on with this course?
Does anyone know why did they use the <source> tag in the <audio> tag? I tried adding the “src” attribute directly to the audio tag and it worked.
Can a media tag have multiple sources or what?
I switched to a paid subscription this week and like you wanted to see if I was able to code first before really investing money into something like this. There are lots of websites out there that are free to use that have similar content but I really like the style of this site and the projects they give you to cement what you have learned. I think you can’t access some content on the free version but you could use other sites in its place.
I’m confused by the src attribute’s placement. Can someone explain why it jumps all over the place for different elements. It’s in the opening tag of the <video> and <image> elements but needs a <source> element for <audio>? Why don’t we need a <source> element for <video> tags?
I’m not entirely sure, but I believe we choose <source> when we want to display more than one type of content. In this link there’s a good example of what I mean.
Not all browsers are compatible with every media format, so we use <source> to make sure various media formats are available to be displayed in case one of them doesn’t load.
If you use the src attribute to link the audio file to the <audio> element, it will most probably work. However, not all browsers support the same audio file type. The <source> element is used to add multiple sources E.g. a .mp3 version and a .webm version. This will make your <audio> element accessible from all browsers
The HTML <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. It is an empty element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats. - MDN
Hey, sorry i’m new to this whole form thing, so I don’t actually know if this is where I should post this question… but I was on the semantic HTML lesson in codecademy, in the video element portion and I tried to place the autoplay attribute and tried refreshing the page but the dog video never played by itself.
The exercise 8 Video and Embed of the Semantic HTML chapter says:
Note that <embed> is a deprecated tag and other alternatives, such as <video> , <audio> and <img> , should be used in its place, but is being taught for legacy purposes.
Why does it say that <embed> is a deprecated tag while on MDN it has HTML5 Recommendation specification?
I wouldn’t say it was deprecated, just should be used when necessary. If you want to display an image, use the <img /> element. If you want to display a video, use the <video /> element. If the media you want to embed doesn’t have a specific tag for it, then you could use the <embed /> element
As of now, most browsers can only autoplay muted videos meaning you have to add the mute attribute. This will make the video autoplay while muted, and then the user can manually turn the sound on