Skip to content

Instantly share code, notes, and snippets.

@Natim
Created April 3, 2012 15:38
Show Gist options
  • Save Natim/2292988 to your computer and use it in GitHub Desktop.
Save Natim/2292988 to your computer and use it in GitHub Desktop.
Vimeo Javascript Display Thumb
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function vimeoLoadingThumb(id){
var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showThumb";
var id_img = "#vimeo-" + id;
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = url;
$(id_img).before(script);
}
function showThumb(data){
var id_img = "#vimeo-" + data[0].id;
$(id_img).attr('src',data[0].thumbnail_medium);
}
</script>
</head>
<body>
<img id="vimeo-6271487" src="" alt="This is the example" />
<script type="text/javascript">
vimeoLoadingThumb(6271487);
</script>
</body>
</html>
@bkvirendra
Copy link

Thanks !!!!!
Was really helpful !!!!!!!

@iancamleite
Copy link

Works well, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment