JSFiddle - React, Tailwind, and code Playground

HTML

<iframe width="560" height="315" src="http://www.youtube.com/embed/dd8W4PNUU3Q?rel=0" frameborder="0" allowfullscreen></iframe>

JavaScript

var RE = /embed\/([a-zA-Z0-9_-]{11})/;

jQuery( "iframe" ).each(function(){

var id = (this.src.match( RE ) || [])[1];

    if( id ) {
    jQuery( this ).replaceWith( '<a href="http://www.MYURL.com/?v='+id+'">'+
                                '<img src="http://i1.ytimg.com/vi/'+id+'/hqdefault.jpg"'+
                                ' class="someClass" /></a>' );
    }

});