Hacker News new | ask | show | jobs
by chrismorgan 1375 days ago
I believe this is about allowing this kind of markup (that exists on old web pages that haven’t been updated for a long time) to still work:

  <embed src="http://www.youtube.com/v/dQw4w9WgXcQ"></embed>
… by roughly translating it into

  <iframe src="http://www.youtube.com/embed/dQw4w9WgXcQ"></iframe>
Probably also the <object> equivalent, maybe only that and not <embed>, I’m not sure. I never had a great deal to do with those two tags.

I don’t know why it has to be done this way. I’d have thought that without this extra code it’d roughly fall back to being an iframe on the original URL, and then YouTube could just check if it’s in a frame and behave as an embed instead of the main UI. But there’s probably a reason why they’ve all done it this kind of way.

4 comments

It's strange that they thought of essentially taking responsibility for a change that YouTube did to break embeds.
Someone correct me if I'm wrong, but I think <embed> was used because it embedded a flash player, back when flash existed on the web. Then browsers decided to get rid of flash, and something had to replace it. You can't <embed> HTML pages, so wasn't really up to YouTube if to break it or not.
> Someone correct me if I'm wrong[...] You can't <embed> HTML pages

You are wrong.

16 people say I'm right, one person say I'm wrong. I'm not doubting you, but I'd love it if you could show how I'm wrong? Maybe I misremember how to use <embed>.
Just try it. Here’s a sample URL:

  data:text/html,<embed src=https://example.com>
(Mind you, this shows that it works now, without commenting on whether it worked then, which I know not.)
> 16 people say I'm right

Where? To be clear, it doesn't matter—being wrong is wrong. Those other people, even if they exist, are wrong, too.

(I can half-understand not checking before you posted the original comment. But why wouldn't you, in response to someone letting you know that you are wrong—which was itself in response to you asking, by the way—take half as much time to just check as the amount of time it took to type out such an bewilderingly obnoxious followup?)

Youtube didn't change - browsers did. Embed loads plugin content: browsers broadly moved away from plugins (they'll still technically work if you feel like jumping through installation hoops as a user but they're not maintained and not broadly preinstalled as they used to be).

During this broad migration by the browser community away from supporting plugins within embed tags, there was likely some audits of how widely they were relied upon across the web, and compat hacks put in place to account for the most common uses.

It's very likely Youtube removed endpoints after the browser hacks were in place for some time.

It’s pragmatic. End users don’t care enough to place the blame correctly. All they think is “my iPhone can’t play this video that my friend sent me, my phone sucks”. It just doesn’t matter whose fault it is that that’s the reality.
the all the embed tags video broke on my old site with youtube video embed when this was done, I just changed my code, but I guess a lot people probably complained. So there you go.
Am I the only one who actually visited this Youtube link by copying and pasting in address bar?
Anyone who’s been on the Internet long enough will have wisened up to the fabled YouTube link ending in in XcQ.
> Anyone who’s been on the Internet long enough will have wisened up to the fabled YouTube link ending in in XcQ

"We've known each other for so long"

Funny, it’s the dQw that I recognise.
I didn’t need to, there’s only one video that makes sense, and the “…XcG” seemed familiar
So much that the poor people who were also randomly given a URL finishing with XcQ can’t make people read their video, and Youtube will need a specific exception to ensure generated codes don’t finish with that.
Something really really wrong just happened, I just saw an ad on Youtube. I didn't think that was possible.