The following function takes this kind of input:

- http://www.youtube.com/watch?v=iwGFalTRHDA
- http://www.youtube.com/watch?v=iwGFalTRHDA&feature=related
- http://youtu.be/iwGFalTRHDA
- http://youtu.be/n17B_uFF4cA
- http://www.youtube.com/watch?v=t-ZRX8984sc
- http://youtu.be/t-ZRX8984sc
- https://youtu.be/t-ZRX8984sc

And it returns an iframe you can embed in your page.

function embedYoutube (link) {  
    var regex = /http(?:s)?:\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?​=]*)?/ig;

    var match = this.regex.exec(link);
    var url = 'http://www.youtube.com/embed/' + match[1];
    var width = 400;
    var height = width * (9/16); // 16/9 ratio

    var $html = $('<iframe/>')
    .attr('witdh', $('.add-tags').width())
    .attr('height', $('.add-tags').width() * (9/16)) // 16/9 ratio
    .attr('frameBorder', 0)
    .attr('src', url);

    return $html.prop('outerHTML');
}

Output:

<iframe  
width="420" height="315"  
src="http://www.youtube.com/embed/Vid3o_iD"  
></iframe>