I want to pull an image from a vimeo file. This example pulls from a hyperlink
$ ("a[href*='/vimeo.com'], a[href*='.vimeo.com']").addClass('vimeo').each(function () {
var url = $ (this).attr('href'),
regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)($ |\/)/,
match = url.match(regExp),
vimeoVideoID = (match[2]),
thumbImg = $ ('<img class="vimeothumb" width="268" height="171" alt="vimeo video thumbnail" border="0" />'),
that = this;
$ .getJSON('http://www.vimeo.com/api/v2/video/' + vimeoVideoID + '.json?callback=?', {
format: "json"
}, function(data) {
thumbImg.attr("src", data[0].thumbnail_large);
$ (that).append(thumbImg);
});
});
How can I change it to pull from <iframe src="http://player.vimeo.com/video/13843151" width="250" height="140" frameborder="0"></iframe>
instead of <a href="http://vimeo.com/15065164"></a>
?