If a YouTube iframe embed code is ...
<iframe width="560" height="315" src="http://www.youtube.com/embed/dd8W4PNUU3Q?rel=0" frameborder="0" allowfullscreen></iframe>
how can you extract dd8W4PNUU3Q
ie, the video id
and replace the entire iframe with
<img style="background-image:url('http://i1.ytimg.com/vi/dd8W4PNUU3Q/hqdefault.jpg');" class="someClass"/>
and wrap the image with a <a>
giving...
<a href="http://www.MYURL.com/?v=dd8W4PNUU3Q"><img style="background-image:url('http://i1.ytimg.com/vi/dd8W4PNUU3Q/hqdefault.jpg');" class="someClass"/></a>
Jsfiddle: http://jsfiddle.net/4E3DH/1/