So if the image tag is
<img src="http://i1.ytimg.com/vi/LL0Y4MZ45bo/0.jpg" class="youtubeimg"></img>
I don't know how to extract the YouTube video id (LL0Y4MZ45bo
) from the thumbnail image src and then apply it to an iframe.
currently i have 100% working, which applys the src to the iframe. but what i dont know how to do is get the id from the img tags in this case LL0Y4MZ45bo
and add it to the youtube embed src http://www.youtube.com/embed/LL0Y4MZ45bo
<iframe src="" class="youtubeiframe"></iframe>
<script>
$(".youtubeiframe").attr({
src: "http://www.youtube.com/embed/VIDEO-ID-EXTRACTED-FROM-THUMBNAIL-SRC",
});
</script>
so how can I extract id from the img and apply to iframe src?