Youtube link to Embed code

Allowing users of your website to include a video into a message, can be done in two ways.

  1. You instruct all the users to go to the video page, find the embed code, let them upload html to your website and displaying the raw html to all users.
  2. You tell them to paste the link to the youtube page, and your website generates the embed code right from that link.

While the first option seams like the easiest one (for you as a programmer), it might also be a bad choice in user-friendliness and security wise it isn’t very smart to allow the user to upload html (especially iframes).

The second option, allowing just pasting the link, would seem like a lot of work. But it is actually quitte easy.

Leave a Comment

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *


Deze website gebruikt Akismet om spam te verminderen. Bekijk hoe je reactie-gegevens worden verwerkt.