Categories
Uncategorized

Embedding Youtube Videos using iFrame

With a new URL structure, it’s really easy to embed any youtube video on a webpage. This is what you need to do:

  1. Get the video identifier. If the “watch” url is “http://www.youtube.com/watch?v=VpVrMMcLfk4” then the
    identifier is “VpVrMMcLfk4”. That is the value of the “v” parameter.
  2. Insert an iFrame with the src = “http://www.youtube.com/embed/< identifier >“

Here’s a code snippet for your copy paste comfort 😀 :

So, how does the video look like? 🙂 Watch it below :