How to Create a YouTube Embed Plugin for WordPress

Dislike - you are copying native wordpress functionality, with much worse experience for editor (no preview, need for useless shortcode …) and why? Just because you want your youtube to be responsive? This can be FAR more easier - simply use embed_oembed_html or oembed_result filter, and modify the HTML produced by the native wordpress oembed. It is generaly one row formula. E.g. if you are using twitter bootstrap and are preparing 16 by 9 videos, you can simply enclosed the produced embed code to div with class “embed-responsive embed-responsive-16by9” and it will automagicaly fit available place.