How to decide between video and embed?

Hi Evie!

The <embed> element is certainly not deprecated, and is included in the HTML5 standard.
https://html.spec.whatwg.org/#the-embed-element

The <embed> element was historically used to embed browser plug-ins such as Flash. These plug-ins have been deprecated by most modern browsers.

That being said, elements such as <audio>, <video>, etc. are more semantically correct when you are embedding those types of content.

Some of the more compelling reasons to not use the <embed> element are that it does not allow child elements like the <audio>, <video> elements do, therefore you can not specify fallback sources for your content.

Perhaps more importantly, current browser support for the <embed> element is less than impressive. iOS Safari versions prior to 16.2 do not support <embed>, accounting for nearly 40% of browser usage in the U.S. alone.
https://caniuse.com/?search=embed

Hope this helps!

2 Likes

Hi Chad,
Thank you very much! Your explanation was very helpful!

Maybe the lesson organizers should change that Note, or reword it to make more sense. :wink:
Thanks again,

Evie

1 Like

how to add gifs in a webpage? using video tag or img tag?

Use the embed tag, even it is deprecated, it works.

1 Like

embed is quasi deprecated.

Depending on the media you want to incorporate, use img, iframe, video and audio tags instead.

some browsers may not support the audio and video element so at those times embed element can come into use

The ‘embed’ tag is a deprecating tag meaning that even though it works, it will at some point soon be phased out so best practice would be to use the corresponding video, audio, etc. tag.

You should use appropriate tags as long as you can such as
<video /> for video, <audio /> for audio and <figure /> for image, illustration, code snippet,etc.. because <embed /> is deprecated !

1 Like