FAQ: Semantic HTML - Video and Embed

I believe you can write <audio> with the src attribute the way you did with <video> and vice versa. <source> seems to be good when you want to add multiples videos/audio files

According to W3Docs, the <embed> tag is deprecated in favor of the <object> tag.

How to enable a video to play on new tab or window?

Hi everyone, I tried the target="_blank" attribute and value ALONE (without the anchor tag) in my attempts to get the video to play on another tab but it didn’t. So I put the target="_blank" in the video element’s opening tag.

I tried to include the anchor tag by setting the href’s value to # (dead link) (href="#"). When I click the play button, the video does not open in another tab, but when I click the middle of the video it opens in another tab BUT it displays the entire page with the content of the web page I want the video to play separate from.

QUESTIONS:

  1. How do I get the video to play (on it’s own) on another tab?
    OR 2. How do I get the video to automatically play full screen when the user plays it (even if this may be annoying I’d like to know how to do it).
  2. How do I get a YouTube video embedded on my page to play in YouTube when the play button is pressed, and also, 4., how do I get a YouTube video embedded on my web page to NOT auto jump to YouTube to play (but play on my web page)?

Thank in advance.

In the New York City Blog practice, we’re instructed to use the deprecated tag <embed/> for one of the images. Another person mentioned using <figure> as an alternative, but it got me wondering when to use <figure> instead of <img>. I understand that an advantage of <figure> is the ability to add a <figcaption> but are there any considerations when deciding whether to use <figure> versus <img>?

I have this same question. MDN’s article on <embed> states:

Note: This topic documents only the element that is defined as part of HTML5. It does not address earlier, non-standardized implementation of the element.

Can someone perhaps explain when using <embed> is the best option, as there are no better alternatives?

The lesson says is deprecated, but doesn’t say what the alternative is, then, for gif files.

Hey, @design8697248739 welcome to the forums.

You would use a <img> tag for gifs.

1 Like

Ah, thank you very much.

1 Like

No problem. I just made a pull request adding that you use the img tag for gifs to the CC.

1 Like

Thanks for the prompt update!

Just as an update on the PR its probably getting merged in the next hour.

1 Like